Comma Separator: Separate a List With Commas
Used when Join with is set to a separator you type.
Line breaks always split too. An item in quotes stays whole, separator and all.
Used when Split the list on is set to a separator you type.
Numbers sort as numbers, so 2 comes before 10.
the list apple, banana, cherry
How do you convert a column into a comma-separated list?
A comma-separated list, also called comma-delimited, is one line of text with a separator between each item. This page converts a column of lines into that line, and back again.
- Paste your column into the box above, one item per line.
- Choose the separator you want between the items. The comma is the default; the tab, the semicolon and the pipe are on the same control, and you can type a character of your own.
- Choose whether the items are quoted. RFC 4180 rule 6 says fields containing line breaks, double quotes or commas should be enclosed in double quotes, and rule 7 says a double quote inside a quoted field is escaped by preceding it with another double quote.
- Set the tidy-up you want: trim the ends of each item, drop blank lines, remove repeats, and sort A to Z or Z to A.
- Copy the line out of the output box. The conversion runs both ways on this one page: lines into a delimited list, and a delimited list back into lines. There is no separate inverse URL.
This page joins a column into one line and counts its items; to check that line against a character limit, the word counter counts its characters.
The same three items under four separators
Each row runs one input — three items, one per line — through a different separator. The character between the items is the only thing that changes from row to row.
| Separator | Character | The line it produces |
|---|---|---|
| comma | , | apple, banana, cherry |
| tab | tab | apple banana cherry |
| semicolon | ; | apple; banana; cherry |
| pipe | | | apple| banana| cherry |
Worked Example: four lines into one
Four lines, one of them blank, become apple, banana, cherry on a single line. The blank line is dropped, the spaces around each item are trimmed, and a comma and a space join what is left.
apple, banana, cherry
The output has three items rather than four because the blank line carried nothing to join. Turn the drop-blanks control off and it comes back as an empty item between two commas, which is what a spreadsheet would read as an empty cell.
What Changes the Output Line?
The separator you choose
A comma is the default because it is what most tools expect, but any character can do the job. Choose the tab when the items already contain commas, and the pipe when they contain both. Whatever you pick, the receiving program has to be told.
Trimming, blank lines, repeats and order
Text pasted out of a spreadsheet or a document usually carries trailing spaces and an empty line or two. The tidy-up runs in a fixed order: trim, drop blanks, remove repeats, then sort, with numbers in number order so item 2 comes before item 10.
Items that hold a comma
Smith, John is one item with a comma inside it. Quote it, and splitting the list back reads the quotes and keeps the item whole, so the round trip gives back what you started with.
What this page does not do
This page rewrites text you paste. It does not open, convert or re-save a file, and it changes nothing about how your spreadsheet exports one.
Frequently Asked Questions
Is comma separated the same as CSV?
A comma-separated list is one line of text. CSV is a file format that also fixes how a value containing a comma, a quote or a line break is written.
What is a delimiter?
A delimiter is the character that marks a boundary between values in a line of text; the comma is the usual one, with the tab, the semicolon and the pipe as the common alternatives.
What is a comma separator?
It is a tool that separates a list with commas, so a column of lines becomes one line of comma-separated text. This page does that, and the reverse, on the same URL.
Why is my CSV file not comma-separated?
Spreadsheet programs follow the machine's list separator, and in locales where the comma is the decimal mark that separator is a semicolon, which is why a CSV file can open without a single comma in it.
How do you put each item in quotes?
Set the quoting control above the box. Single and double wrap every item. The RFC 4180 setting wraps only the items that need it, which is what a spreadsheet expects.
How do you turn a comma list back into one item per line?
Use the direction control above the box. The list is split on whatever delimiter it uses, found by counting, or on one you choose; an item in quotes stays whole, and the same trimming, sorting and duplicate options apply.
The rest of the site is on the full tool index.