Comma Separator

Paste a column of values, one per line, and get them on a single line separated by commas. Switch the direction to do the reverse and split a comma-separated list into one item per line.

0 words · 0 characters

Example

A column joined with a comma and a space

Before
apple
banana
cherry
date
After
apple, banana, cherry, date

Column to comma-separated list

Copy a column from Excel or Google Sheets, or any list with one item per line, and paste it in. Each line becomes one item. Spaces at the start and end of a line are trimmed and empty lines are skipped, so a column with gaps still gives a clean list. The note above the result shows how many items there are.

Pick the delimiter your destination expects: a comma and space for readable text, a bare comma for CSV-style input, a semicolon for email recipients in Outlook, a pipe or tab for data files.

Adding quotes for SQL and code

Choose single quotes and a comma delimiter to turn a column of IDs or names into the inside of a SQL IN (…) clause: 'A102', 'A417', 'B220'. Double quotes give you the body of a JSON or JavaScript array of strings. The tool wraps items as they are and does not escape a quote mark that is already inside an item, so check items like O’Brien by hand.

Comma-separated list to lines

Set Convert to “Delimited list to lines” and choose the delimiter the list uses. Each item goes on its own line, trimmed, with one pair of surrounding quotes removed. A list that is already spread over several lines is handled too. With “Comma and space” selected, items are split at every comma whether or not a space follows it.

This is a plain splitter, not a CSV parser: a delimiter inside a quoted value, as in "Smith, John", is treated as a split point. For data like that, open the file in a spreadsheet instead.

Doing the same thing in a spreadsheet

In Excel 2019 or later and in Google Sheets, =TEXTJOIN(", ", TRUE, A1:A50) joins a range with a delimiter and skips blanks. This page is quicker when the list is not in a spreadsheet, when you need quotes around each item, or when you want to go in the other direction. Afterwards, Sort Alphabetically and Remove Duplicate Lines tidy the list further.

Frequently asked questions

How do I convert a column to a comma-separated list?

Paste the column into the box with one value per line. The result is all the values on one line with a comma and a space between them. Change the Delimiter menu for a different separator.

How do I add single quotes and commas to a list?

Leave Convert on “Lines to delimited list”, set “Wrap each item in” to single quotes, and choose a delimiter. Each value comes out as 'value', ready for a SQL IN clause.

Can it split a comma-separated list into separate lines?

Yes. Set Convert to “Delimited list to lines” and pick the delimiter used in your text. Every item is placed on its own line.

Does it keep empty lines or extra spaces?

No. Blank lines are dropped and spaces around each item are trimmed, in both directions.

Does it understand quoted CSV values that contain commas?

No. It splits at every delimiter, including ones inside quotes. Use a spreadsheet for real CSV files.