Data often arrives in the wrong shape: a column of IDs in a spreadsheet when your query needs a comma-separated list, or a long comma-separated line when you need one item per row. Retyping is slow and error-prone, especially once quotes are involved. This converter handles both directions.
Typical jobs
- SQL: build IN clauses from exported IDs or email addresses.
- Code: turn a list of values into a JavaScript, Python or JSON array.
- Tags and keywords: join keywords for a CMS field that expects commas.
- Spreadsheets: split a comma-separated cell into rows, or the reverse.
How to use the List to Comma-Separated Converter
- Paste your list, one item per line — for example, a column copied from Excel or Google Sheets.
- Choose the separator (a comma and space by default), and whether to wrap items in quotes.
- Pick brackets if you need a SQL
IN ( … )clause or a JSON/Python array. - To go the other way, choose One line → list or click Swap.
Features
- Any separator: comma, semicolon, pipe, tab (\t) or new line (\n).
- Double quotes, single quotes or backticks, with quotes inside values escaped.
- Optional duplicate removal and empty-line skipping.
- Reverse mode splits on any separator and strips surrounding quotes and brackets.
Frequently asked questions
How do I make a SQL IN clause from a spreadsheet column?
Paste the column, choose Single quotes and Round brackets. You’ll get ('a', 'b', 'c'), ready for WHERE id IN (…). Apostrophes inside values are escaped so the query stays valid.
How do I create a JSON array of strings?
Choose Double quotes and Square brackets with a comma and space separator. The result, like ["red", "green"], is valid JSON for simple values.
Can I split a comma-separated line into rows for Excel?
Yes. Choose One line → list. Each item appears on its own line, and pasting the result into a spreadsheet puts each value in its own row.
Written by Dewan Razib