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
,— comma and space. Human-readable lists, email recipients.,— comma only. CSV values and most code.;— semicolon. Outlook recipient fields, and CSV in locales where the comma is the decimal mark.|— pipe. Log formats and data that itself contains commas.\t— tab. Pasting a row straight into a spreadsheet.\n— newline. Splitting a list back into a column is just this with the buttons reversed.
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.
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
- Paste your column of values into the box, one per line.
- Set the separator — the default is a comma and a space.
- Press "Lines → separated list".
- To go the other way, paste the separated list and press "Separated list → lines".
Related tools
Frequently asked questions
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.
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.
They are dropped when joining, because keeping them would produce a double separator that breaks most things you paste into.
Yes, tick "Wrap items in quotes". Quotes already inside a value are escaped so the output stays valid.
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.