About the Comma Separator
This comma separator converts a list with one item per line — such as a column copied from Excel or Google Sheets — into a single comma-separated line, and back again. Choose the delimiter (comma, comma and space, semicolon, pipe, tab or anything custom), wrap each item in single or double quotes, and optionally surround the whole list with parentheses or square brackets.
Developers use it to build SQL IN (…) clauses, JavaScript or Python arrays and CSV rows from a pasted column; marketers and analysts use it to turn keyword or email columns into a single line for forms, filters and tag fields. Switch to "split" mode to break a comma- or semicolon-separated string into one item per line for pasting into a spreadsheet.
Items are trimmed and blank entries removed by default, and you can drop duplicates in the same step. With double quotes, any double quote inside an item is escaped by doubling it, following the CSV convention (RFC 4180). Everything runs locally in your browser.
How to use the comma separator
- 1Paste a column of values (one per line) or a delimited list.
- 2Choose the direction: lines to a delimited list, or a list back to lines.
- 3Pick the delimiter, or enter a custom one.
- 4For code or SQL, add quotes around each item and wrap the list in brackets or parentheses.
- 5Copy the result.
Formula and method
In join mode the input is split at every line break, each item is trimmed and blank lines are dropped (if enabled), optional duplicates are removed keeping the first occurrence, and each item is wrapped in the chosen quote character. Items are then joined with the delimiter and the whole list is optionally wrapped in parentheses or brackets.
Quotes inside items are escaped by doubling them — "" inside double quotes (the CSV rule from RFC 4180) and '' inside single quotes (the SQL rule). In split mode, surrounding brackets are removed, the text is split at the delimiter and at line breaks, and matching quotes around each item are stripped.
Worked examples
Column to comma-separated list
Four lines are joined with a comma and a space, producing a single line you can paste into a tag field or an email.
Build a SQL IN clause from IDs
The blank line is dropped and the repeated 102 removed, leaving 3 IDs. Each is wrapped in single quotes, joined with commas and surrounded by parentheses — ready for WHERE id IN (…).
Semicolon list back to a column
The text is split at each semicolon and the stray spaces trimmed, giving three lines ready to paste into a spreadsheet column.
Frequently asked questions
How do I convert a column in Excel to a comma-separated list?+
Copy the column, paste it here, choose "Column → delimited list" with a comma delimiter and copy the result. In Excel 2019 or later you can also use =TEXTJOIN(", ",TRUE,A1:A100).
How do I make a list for a SQL IN clause?+
Paste your values one per line, choose the comma delimiter, single quotes and parentheses. The output looks like ('a','b','c') and can go straight after WHERE column IN. Omit the quotes for numeric columns.
How do I split a comma-separated list into rows?+
Paste the list, choose "Delimited list → column" and the matching delimiter. Each item appears on its own line, ready to paste into a spreadsheet column. Surrounding quotes are removed automatically.
What happens to commas inside items?+
In join mode the items are kept as-is, so choose double quotes if items can contain commas — that is how CSV files protect them. In split mode, a comma inside quotes is still treated as a delimiter, so use the CSV to JSON tool for full CSV parsing.