How to use the column to comma separated list converter tool
- Paste your data. Copy a column from Excel or Google Sheets (one item per line) or paste a comma-separated string.
- Set the input and output separators. For a column → comma list keep input as “New line” and output as “Comma + space”. For the reverse, choose Comma as the input and New line as the output.
- Add quotes or other wrappers. Wrap each item in double or single quotes for SQL, Python, JavaScript or JSON lists, and optionally add a prefix or suffix.
- Copy the result. Paste it straight into your query, code or email client.
Common uses
- Build an SQL IN (...) list from a spreadsheet column
- Turn lines of tags or keywords into one comma-separated field
- Split a comma- or semicolon-separated string into one item per line
- Convert between delimiters: comma, semicolon, pipe, tab, space
A worked example
A column of five made-up names, with one repeated:
Ava
Ben
Cleo
Dev
Ben
With “Remove duplicates”, a comma separator and single quotes around each item, the result is 'Ava','Ben','Cleo','Dev': five rows in, four items out. Add the option to wrap the whole list in parentheses and it is ready for an SQL IN clause. The full guide to converting a column to a comma separated list covers Excel, Google Sheets and SQL in depth.
What the options are for
| Option | Why it exists |
|---|---|
| Input and output separators | Column to comma list, comma list to column, or any other pair: semicolon, pipe, tab, space or custom |
| Wrap each item | Text values need quotes in SQL, JSON and most code |
| Escape quotes inside items | A name like O’Brien breaks 'O'Brien'. Doubling the quote gives 'O''Brien' (SQL and CSV); a backslash gives 'O\'Brien' (code) |
| Wrap the whole list | Put the list inside ( ) for SQL, [ ] for arrays and JSON, or { } |
| Split into groups of N | Some databases limit an IN list (Oracle has historically allowed 1,000 expressions). Groups are separated by a blank line |
| Remove duplicates, trim, remove empty | Keeps the list short and avoids stray spaces and empty items |
Common mistakes
- Forgetting that values may contain commas. In a comma separated list,
Smith, Johnbecomes two items. Quote the values or use a different separator. - Leading zeros lost in Excel. If ZIP codes or IDs lose their zeros, format the column as Text before copying it.
- Building SQL for an application. Pasting values into a query is fine for a one-off. In application code, use parameterised queries.
Frequently asked questions
How do I convert a column to a comma-separated list?
Paste the column into the input, keep “Input is separated by” on New line, and choose Comma (or Comma + space) as the output separator.
How do I convert a comma-separated list into separate lines?
Set the input separator to Comma and the output separator to New line.
How do I build a list for an SQL IN clause?
Wrap each item in single quotes, use Comma as the output separator, and add parentheses around the result. Use Remove duplicates to keep the list short.
Can it handle several different delimiters at once?
Yes. Choose “Auto” as the input separator to split on commas, semicolons, tabs, pipes and line breaks together.
Does it remove blank lines and extra spaces?
Yes. “Remove empty items” and “Trim whitespace” are on by default.
Is my data sent anywhere?
No. The conversion happens in your browser only.
More tools: Email Extractor · Compare Lists · Remove Duplicates · Sort Lines · List Converter