Comma Separator
Comma Separator is a free browser tool that turns a column of items into a comma-separated list, or splits a list back into one item per line.
Turn a column of items into a comma-separated list, or split a list back into one item per line, with your choice of separator, quotes and duplicate removal. Runs in your browser.
Also searched as: comma separating tool · column to comma separated list · convert column to comma list · comma separated list converter · add commas to a list
Loading the tool…
How to use it
- 1
Paste your items
One item per line, such as a column copied from a spreadsheet.
- 2
Choose the separator
Pick comma, semicolon, tab, pipe, space or your own, and add quotes if you need them.
- 3
Copy the result
See how many items there are, then copy the list.
Questions about Comma Separator
How do I turn a column into a comma-separated list?
Paste the column, keep "Column to list" selected and copy the result. Each line becomes one item and the items are joined with a comma.
Can I put quotes around each item?
Yes. Choose double or single quotes under "Wrap each item in". A quote of the same kind inside an item is doubled, as in CSV and SQL, so say "hi" becomes "say ""hi""".
Is my list sent anywhere?
No. The conversion runs in your browser and nothing is uploaded.
How do I make a list for an SQL IN clause?
Choose "Comma and space", wrap each item in single quotes and copy the result. Paste it between the brackets of IN ( ). A single quote inside an item is doubled, which is how SQL writes it.
Can it split a list that has commas inside quotes?
Yes. An item that starts with a quote is read up to its closing quote, so "Paris, France" stays one item. If a quote is never closed, the list is split at every separator instead.
Turning a column into a list
A column copied from a spreadsheet, a database or a document has one item per line. Many places want the same items on a single line instead: a tag field, an email recipients box, a search filter, a function call or an SQL query. This tool keeps the items in order, joins them with the separator you choose and shows how many it found.
The table runs the same three lines, red, green and blue, through different settings. The quote marks in the last two rows are part of the result.
| Settings | Result |
|---|---|
| Comma | red,green,blue |
| Comma and space | red, green, blue |
| Semicolon | red;green;blue |
| Comma, double quotes | "red","green","blue" |
| Comma and space, single quotes | 'red', 'green', 'blue' |
Quotes, duplicates and empty lines
Quotes make a list safe to paste into code or a data file. A quote of the same kind inside an item is written twice, which is the rule in CSV files and in SQL, so the list can be read back without losing anything. The table shows three items under each kind of quote.
“Trim spaces around items” removes spaces and tabs at the start and end of every line. “Skip empty items” drops blank lines, so you never get two commas in a row. “Remove duplicates” keeps the first copy of each item and tells you how many it dropped. Items are compared exactly, so Ava and ava count as different items; to ignore case, change the text with Case Converter first.
| Item | In double quotes | In single quotes |
|---|---|---|
| Ava | "Ava" | 'Ava' |
| O'Brien | "O'Brien" | 'O''Brien' |
| 5" pipe | "5"" pipe" | '5" pipe' |
Turning a list back into a column
Choose “List to column” to go the other way. The list is split at every separator and each item goes on its own line, with the spaces around it trimmed. With “Comma and space” selected the list is split at the comma and the space is trimmed, so a list written either way works.
An item that starts with a quote is read up to its closing quote, so the comma in “Paris, France” does not split it. “Remove quotes around items” takes the quotes off and turns doubled quotes back into single ones. If a quote is never closed, the list is split at every separator instead.
Everything runs in your browser. The text you paste is not uploaded or saved, and it is gone when you close the tab.