How to Turn a List into a Comma-Separated String

You have a column of values - tags, IDs, names - and need them as a single comma-separated line for a spreadsheet formula, a config value, or a report. Joining dozens of lines with commas by hand, and getting the quoting right for any value that itself contains a comma, is fiddly to do manually. Paste the list here and it joins instantly.

Join your list now. Free, no account needed.

Open List Format Converter →

How to do it

  1. Paste your list into the converter. One value per line.
  2. Select CSV Row from the format dropdown.
  3. Set the delimiter, if not a comma. Semicolon, pipe, and tab are common alternatives.
  4. Copy the single-line output.

A list like this:

apple
banana
cherry

becomes:

apple,banana,cherry

Values that contain the delimiter

If a value already contains a comma - a name written "Smith, John", or a description with commas inside it - joining naively would break the result into the wrong number of fields when someone later splits it back apart. The converter handles this by wrapping any such value in double quotes automatically: Smith, John becomes "Smith, John" in the joined string. Values with no comma, quote, or line break are left unquoted, keeping the output as compact as possible.

If a value contains a double quote itself, it's escaped by doubling it - the standard CSV convention, the same one Excel and Google Sheets use for their own CSV exports. This means the result can always be split back apart correctly, even with tricky data.

Choosing a different delimiter

A comma is the default, but not always the right choice - if your values themselves regularly contain commas, a semicolon or pipe (|) delimiter avoids most of the quoting altogether. A tab delimiter (TSV format) is a good choice when pasting straight into a spreadsheet, since most spreadsheet apps split pasted tab-separated text into columns automatically.

Going the other way: string back to a list

Paste a comma-separated (or other delimiter) line into the input and the tool detects it automatically, splitting it back into one value per line - correctly handling any quoted values that contain the delimiter itself.

Need other formats from the same list?

JSON array, SQL IN clause, Markdown, HTML list: 21 formats, same tool.

Open List Format Converter →

Frequently Asked Questions

How do I turn a list into a comma-separated string?
Paste your list (one item per line) into the List to Format Converter, select CSV Row, and copy. Every line is joined with a comma into a single line.
Can I use a different delimiter, like a semicolon or pipe?
Yes. The delimiter field accepts any character - semicolon, pipe, tab, or a custom separator - and the tool joins with whatever you set, not just a comma.
What happens if one of my values already contains a comma?
It's automatically wrapped in double quotes so the result stays a valid CSV row - a value like Smith, John becomes "Smith, John" in the output. Values without a comma, quote, or line break are left unquoted.
What if a value contains a double quote?
The quote is escaped by doubling it, per the standard CSV convention: a value containing He said "hi" becomes "He said ""hi""" in the joined output. This is the same escaping Excel and Google Sheets use, so the result imports cleanly elsewhere.
Is this the same as Excel's TEXTJOIN function?
Functionally similar for a single column - both join values with a delimiter. TEXTJOIN operates inside a spreadsheet on cell ranges; this tool works directly on pasted text, so there's no spreadsheet or formula involved.
Can I join lines with a tab instead, to make a TSV row?
Yes. Select the TSV format instead of CSV - it joins every line with a tab character, useful for pasting into a spreadsheet where each value should land in its own cell.
Can I convert a comma-separated string back into one item per line?
Yes. Paste a single comma-separated line into the input and the tool detects it automatically, splitting on the delimiter (respecting quoted values that contain a comma) and giving you back one item per line.
Can I get other formats from the same list?
Yes. The same input works for a SQL IN clause, a JSON array, Markdown, and HTML - switch the dropdown without re-pasting anything.

Share this tool

Featured on ToolDirs
© 2026 ListDiff

Free online list and text processing tools.