Column to comma separated list

Turns lines into one separated string — and back again.

Paste a column — one item per line — and get a single line with your separator between the items. Press the other button to go back the other way. The separator field accepts anything: a comma, a semicolon, a pipe, a space, or \n and \t for a newline and a tab.

The Excel problem this solves

Copying a column out of Excel gives you one value per line. Almost everything you want to paste it into — a SQL IN clause, a spreadsheet formula, a CSV field, an email recipient box, a tag input — wants them separated by commas on one line. Excel has no button for this. The usual advice is TEXTJOIN(", ", TRUE, A1:A100), which works from Excel 2019 onwards and not at all in older versions or in the middle of an email.

Going the other way is the same story: a comma-separated string pasted into a spreadsheet lands in one cell, and turning it into rows means Text to Columns followed by a transpose, which loses formatting and confuses everyone at least once.

Options that stop the usual breakage

Trim each item is on by default. Values copied out of a spreadsheet or a web table carry trailing spaces you cannot see, and 'apple ' does not match 'apple' in a query. Trimming first is almost always what you want; turn it off only if the spaces are meaningful.

Wrap items in quotes produces "apple", "banana", which is what SQL, JSON and most programming languages need for text values. Quotes already inside an item are escaped so the output does not break.

Remove duplicates deduplicates before joining. A list of customer IDs pulled from two reports usually overlaps, and a query with the same ID twice is slower and sometimes wrong.

Empty lines are always dropped when joining. Keeping them would produce a, , b, which is a syntax error almost everywhere it gets pasted.

Separators worth knowing

Doing it without this tool

Excel 2019 and later: =TEXTJOIN(", ", TRUE, A1:A100). The TRUE skips empty cells. To split back: =TEXTSPLIT(A1, ", ") in Microsoft 365, or Data → Text to Columns in anything older, followed by copy and Paste Special → Transpose.

Google Sheets: =JOIN(", ", A1:A100) and =TRANSPOSE(SPLIT(A1, ",")).

Notepad++: Find & Replace in regular expression mode, search \r\n and replace with , . Watch out on files that use Unix line endings, where you need \n alone — getting this wrong silently leaves half the line breaks in place.

Command line: paste -sd, - < file.txt joins; tr ',' '\n' splits.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.

How to use it

  1. Paste your column of values into the box, one per line.
  2. Set the separator — the default is a comma and a space.
  3. Press "Lines → separated list".
  4. To go the other way, paste the separated list and press "Separated list → lines".

Related tools

Cut charactersCuts a fixed number of characters from the start or end of every line.Add prefix / suffixPuts text at the start and end of every line — quotes, bullets, tags, commas.Text repeaterRepeats your text as many times as you want, with any separator.Join linesMerges every line into a single line with the separator you choose.Cursive textHandwriting-style letters you can paste anywhere plain text goes.Instagram caption lengthThe hard limit is 2,200 characters. The one that matters is the 125 you see…What is a URL slugThree to five words, lowercase, hyphens, no dates. And why changing it later…

See all text tools →

Frequently asked questions

How do I use a tab or a newline as the separator?

Type \t for a tab and \n for a newline in the separator field. They are interpreted as the real characters, which is handy for pasting a row into a spreadsheet.

Will it leave a comma at the end?

No. The separator goes between items only, so there is no trailing comma to delete before you paste the result into code or a query.

What happens to blank lines?

They are dropped when joining, because keeping them would produce a double separator that breaks most things you paste into.

Can I put quotes around every value for SQL?

Yes, tick "Wrap items in quotes". Quotes already inside a value are escaped so the output stays valid.

Does it handle values that contain commas?

When joining, a value containing a comma is left as it is — tick the quotes option so the boundary stays unambiguous. When splitting, the separator is taken literally, so choose one your data does not contain.