Comma Separator
Paste a column of values and get a comma separated list, or paste a comma list and get one value per line. Add quotes and brackets for SQL, JSON or code, remove duplicates, and sort. Your data stays in your browser.
5 items, split on one item per line
What each output looks like
For the column apple, O'Brien, 42:
| Output | Result | Details |
|---|---|---|
| a, b, c | apple, O'Brien, 42 | Comma and a space, nothing quoted. For sentences, emails and tags |
| SQL IN | ('apple', 'O''Brien', 42) | Single quotes, with a quote inside a value doubled as SQL requires. Numbers can stay bare |
| JSON array | ["apple", "O'Brien", 42] | Double quotes with JSON escaping. Also valid as a JavaScript array or Python list |
| CSV row | apple,O'Brien,42 | No space after commas. A value is quoted only when it contains a comma, a quote or a line break, the way RFC 4180 describes |
| Markdown list | - apple on each line | A bulleted list for a README or note |
| Markdown table row | | apple | O'Brien | 42 | | One table row, with any | inside a value escaped |
Common jobs
Spreadsheet column to a SQL IN clause
Copy the cells from Excel or Google Sheets, paste them here and choose SQL IN. A copied column arrives as one value per line, and a copied row arrives separated by tabs; both are detected.
SELECT * FROM orders WHERE customer_id IN (1042, 1043, 1050);Building a query by pasting values is fine for a one-off lookup you run yourself. In application code, pass the values as parameters instead of pasting them into the SQL string.
Comma list to one item per line
Paste the list and choose One per line. Commas inside quotes are kept, so "Smith, Jane", "Lee, Sam" gives two lines, not four.
List of emails for the To field
Paste the column and choose a, b, c, or Custom with ; as the delimiter if your mail program wants semicolons. Tick Remove duplicates first.
Column to a Markdown table or list
Markdown table row gives one row to paste into a table. For a whole sheet use Excel to Markdown or CSV to Markdown, which build the header and alignment row too.
Without a tool
| Where | Column to comma list | Comma list to column |
|---|---|---|
| Excel and Google Sheets | =TEXTJOIN(", ", TRUE, A1:A100) | =TEXTSPLIT(A1, , ", ") in Excel, =TRANSPOSE(SPLIT(A1, ", ")) in Sheets |
| Shell | paste -sd, file.txt | tr ',' '\n' < file.txt |
| Python | ", ".join(lines) | [s.strip() for s in text.split(",")] |
| JavaScript | lines.join(", ") | text.split(",").map(s => s.trim()) |
The one-line versions split on every comma, including commas inside quoted values. For real CSV data use a CSV parser.
Questions
What does "Remove existing quotes, brackets and list markers" do?
It strips one layer of wrapping from the input so you can convert between formats: ('a', 'b'), ["a", "b"] and a Markdown list of - a and - b all become the plain items a and b. Turn it off if the quotes or leading dashes are part of your data.
How are duplicates compared?
Exactly, after trimming if that option is on. "Apple" and "apple" count as different values. The first occurrence is kept and the order is not changed.
Is there a size limit?
No fixed limit. Lists of tens of thousands of lines convert instantly, since everything happens in your browser and nothing is uploaded.
Related tools
- Alphabetize a List: sort lines with natural number order and Markdown list support.
- Remove Line Breaks: join wrapped lines into paragraphs.
- Case Converter: upper, lower, title case and code styles.
- Markdown to CSV: turn a Markdown table into CSV.
- Markdown Table Creator: build a table from scratch.
- JSON to Markdown: turn JSON into a Markdown table.