Comma Separator
Paste a column of values and get one comma-separated line, or paste a delimited list and get one item per line. Use a comma, semicolon, pipe, tab or your own delimiter, and optionally trim spaces, remove empty items, remove duplicates and wrap items in quotes. A SQL IN list preset is included. This tool works on one list of items; for tables with several columns and headers, use the CSV โ JSON converter. Everything runs in your browser.
Result
- Items read
- Empty items removed
- Duplicates removed
- Items in the result
Examples
Five worked examples with the exact result of each setting. In each row, the first code box is what you paste and the second is the result:
| Setting | You paste | Result |
|---|---|---|
| Column to comma-separated list | apple
banana
cherry | apple,banana,cherry |
| Semicolon, space and double quotes | apple
banana
cherry | "apple"; "banana"; "cherry" |
| SQL IN list preset | O'Brien
Smith
00123 | ('O''Brien', 'Smith', '00123') |
| List to column, empty items removed | a,,b, c, | a
b
c |
| List to column, CSV-aware | x,"y,z",w | x
y,z
w |
Formula & Methodology
The tool reads your items, applies only the options you switch on, and writes the result. The steps always run in this order: read the items, trim, remove empty items, remove duplicates, add quotes, join. Trim, empty-item removal and duplicate removal change your data, so they are off by default.
Notes and limitations
- Column to list: each line is one item. LF, CRLF and CR line breaks all work. One final line break is ignored; every other blank line is an empty item.
- List to column, plain reading: the text is cut at every delimiter, exactly as typed. A trailing delimiter makes a trailing empty item, and a line break inside the text stays inside its item (turn on Trim to tidy a list that wraps over several lines).
- List to column, CSV-aware reading: uses the same RFC 4180 reader as the CSV โ JSON converter, so an item in double quotes may contain the delimiter, a line break or a doubled quote (""). A quote only opens a quoted item at the very start of an item. Malformed quotes are reported with their line and column and nothing is converted. Several lines are read as one list in reading order and blank lines are skipped.
- This tool handles one list of items. For a table with several columns, headers or JSON output, use the CSV โ JSON converter.
- A custom delimiter is literal text of up to 16 characters and is never a regular expression. It cannot contain a line break.
- Every value is handled as text, so leading zeros (00123), long IDs and any language, accents or emoji stay exactly as typed. Only a leading byte-order mark is removed.
- Quotes: wrapping doubles a quote of the same kind inside the item. The result is a quoted, joined list. It is not guaranteed to be a valid CSV file.
- SQL IN list: writes literal text for the inside of IN (โฆ). Strings are quoted and a single quote inside a value is doubled, as standard SQL writes it. Choose the second string-escaping option when your database session treats the backslash as an escape character: MySQL and MariaDB do by default (not in their NO_BACKSLASH_ESCAPES mode), and PostgreSQL only when standard_conforming_strings is off. Numbers mode accepts only plain numbers. Nothing is run or checked against a database, and the text is not valid for every database or setting: SQL Server needs an N before text with characters outside its default code page (for example Arabic), and databases limit the number of items in an IN list in different ways. When values come from users or an application, use parameterized queries instead of building SQL text.
- Limit: up to 2,000,000 characters per conversion. Long results show a preview; copy and download include everything.
How to Use
- Choose a conversion: column to delimited list, or delimited list to column.
- Paste your text, or insert the sample.
- Pick the delimiter and the options you need. For a SQL IN list, press the SQL preset.
- Check the item counts and the result, then copy or download it.
Frequently Asked Questions
How do I turn an Excel or Google Sheets column into a comma-separated list?
Copy the cells, paste them into the box, and choose "Column to delimited list" with the comma delimiter. Each line becomes one item. Turn on Trim and Remove empty items if the column has stray spaces or blank cells.
How do I turn a comma-separated list back into one item per line?
Choose "Delimited list to column", paste the list and pick the delimiter. If some items are in double quotes and contain commas, switch to CSV-aware reading so those items stay whole.
What is the difference between plain and CSV-aware reading?
Plain reading cuts the text at every delimiter and treats quotes as ordinary characters. CSV-aware reading follows the CSV quoting rules, so a quoted item can contain the delimiter. For tables with several columns, use the CSV โ JSON converter.
Can I use it to build a SQL IN list?
Yes. Press the SQL IN list preset to get text such as ('a', 'b') with single quotes doubled inside values. The tool never runs SQL. If the values come from users or an application, use parameterized queries instead of pasting text into a query.
Are leading zeros and long numbers kept?
Yes. Every value is handled as text, so 00123 and a 25-digit ID come out exactly as you typed them. In SQL Numbers mode, values with leading zeros are rejected so they are not changed by accident.
Is my list uploaded anywhere?
No. The conversion runs in your browser. Your text is not uploaded, stored or sent to analytics.
Last updated: