Paste a column from a spreadsheet and get a comma separated list. Add quotes and brackets for SQL, Python, or JSON, or turn a comma list back into one item per line.
This tool runs entirely in your browser. What you enter is never sent anywhere.Your input is never sent anywhere.
DetailsOUTPUT PRESETS
How to turn a spreadsheet column into a comma-separated list
Copy a column from a spreadsheet such as Excel or Google Sheets and paste it here. Each line becomes one item, and the output joins the items with commas. You do not need a TEXTJOIN formula or a CSV export.
If you copy several columns, a spreadsheet pastes them separated by tabs. The tool spots this and shows a button for each column, so you can build the list from just one of them.
The presets add the quotes and brackets that code expects: SQL IN, JSON, and Python. Quotes inside values are escaped for you. Switch to Comma → List to go the other way, including quoted CSV values and SQL IN lists.
Where a comma-delimited list comes in handy
SQL IN clause
Paste a column of IDs or names and click the SQL preset. You get ('A', 'B', 'C') ready for a WHERE clause, with apostrophes escaped.
Python lists and JSON arrays
Turn a column of values into a list literal for a script or a config file, with single or double quotes and the right escaping.
Email address lists
Join addresses with a semicolon or a comma before pasting them into a To or BCC field. Which separator your mail app accepts varies.
One item per row again
Paste a comma list, tab list, or SQL IN list and get one item per line. Remove duplicates and sort in the same step.
How to convert a list in 5 steps
- Pick List → Comma to join lines into one string, or Comma → List to split a string into lines.
- Paste your data into the input box. The result updates as you type.
- If you pasted several spreadsheet columns, click the column you want.
- Click a preset such as SQL IN clause or JSON / JS array, or set the delimiter, quotes, and brackets yourself.
- Click Copy result.
Note: In Comma → List mode, the tool checks your input for commas, tabs, semicolons, and pipes, and offers to switch the delimiter if your input uses a different one.
How the converter reads your data
- Spreadsheet paste: one copied column arrives as one value per line. Several columns arrive separated by tabs. When any line contains a tab, the column buttons appear, and All (whole rows) keeps each full row as one item.
- Quotes when splitting: in Comma → List mode, a value wrapped in double or single quotes keeps its delimiters. A quote opens a quoted value only at the start of an item, so an apostrophe in the middle of a word is left alone.
- Brackets when splitting: if the whole input is wrapped in one pair of ( ), [ ], or { }, the pair is removed before splitting. A leading IN or NOT IN is removed as well.
- Escaping quotes in output: when you choose a quote character, quotes inside a value are escaped. Double the quote turns O'Brien into O''Brien (SQL). Backslash turns it into O\'Brien and also escapes backslashes (JSON, JS, Python).
- Leave numbers unquoted: values like 42 and -3.5 stay bare. Values with a leading zero, such as 007, or any other text stay quoted.
- Clean-up: every item is trimmed. Skip empty lines is on by default. Duplicates are matched exactly, including case. Sorting runs after duplicates are removed.
- Tab delimiter: Space after delimiter does not apply when the delimiter is a tab, so pasted columns stay aligned.
Output settings for SQL, Python, JSON, and CSV
Each preset sets the delimiter, quotes, and brackets in one click. You can still change any of them afterward.
| Use | Delimiter | Quote | Brackets | Example output |
|---|---|---|---|---|
| SQL IN (text) | Comma | Single ( ' ) | ( ) | ('A', 'B', 'C') |
| SQL IN (numbers) | Comma | None | ( ) | (1, 2, 3) |
| JSON / JavaScript array | Comma | Double ( " ) | [ ] | ["A", "B", "C"] |
| Python list | Comma | Single ( ' ) | [ ] | ['A', 'B', 'C'] |
| CSV row | Comma | None | None | A,B,C |
| TSV (paste into a spreadsheet) | Tab | None | None | Each item in its own cell |
| Email list | Semicolon | None | None | [email protected]; [email protected] |
| Back to one item per line | Comma → List mode | Optional | Removed | One item per row |
Three ways to make a comma separated list from a column
The first is the TEXTJOIN formula, for example =TEXTJOIN(", ", TRUE, A2:A100). TRUE skips empty cells. It needs Excel 2019 or later, or Microsoft 365, and shows #NAME? in older versions. It adds no quotes. The second is saving the sheet as a CSV file, which is slow if you only need one column. The third is to copy the column and paste it here, which needs no formula or file and adds quotes and brackets in the same step. For a one-off list, pasting is the quickest. For a list you rebuild every week, a TEXTJOIN cell in the sheet saves repeat work.
When to use commas and when to use tabs
If your values may contain commas, such as addresses or product names, a tab is safer. CSV needs quotes around any value that contains a comma, while a tab rarely appears in ordinary text. Tab-separated text also splits into columns when you paste it into a spreadsheet. Systems and APIs that ask for CSV want commas.
Build the list for a WHERE ... IN clause from a pasted column of IDs. Quotes, parentheses, and apostrophe escaping are done for you.
Turn on Remove duplicates and Sort to clean up a mailing list or a product list. The result panel shows how many duplicates were removed.
Quotes, escaping, and limits when a list goes into SQL or code
A few details that decide whether a pasted list works or throws an error.
Apostrophes in SQL string values
A value like O'Brien inside single quotes ends the string early and breaks the query. In SQL, you write a literal apostrophe by doubling it: 'O''Brien'.
With a quote character selected, the Double the quote option does this for every value. Switch to Backslash when the target is JSON, JavaScript, or Python.
Oracle accepts at most 1,000 items in an IN list
Oracle raises ORA-01795 when an IN list holds more than 1,000 expressions. For longer lists, load the values into a temporary table and join to it, or split the list into several smaller IN lists.
The item count appears above the input and below the result, so you can check it before you run the query.
Leading zeros disappear when a CSV opens in Excel
Double-clicking a CSV makes Excel read ZIP codes and IDs as numbers, and the leading zeros are dropped. Import the file with Data > From Text/CSV and set that column to Text instead.
For code, keep such IDs in quotes. Leave numbers unquoted still quotes a value like 007, because a leading zero marks it as text.
Common mistakes when converting a list
Tabs left inside the items after copying several columns
You copy two or more columns from a spreadsheet and paste them straight into a joiner. Each line still contains a tab, so every item carries the second column with it. In SQL or code, that breaks the values, and a tab is hard to spot by eye.
💡 See the solution▼
An apostrophe ends the SQL string early
A name like O'Brien or a company like Joe's Diner sits inside single quotes in your IN list. The apostrophe closes the string, and the query fails with a syntax error or returns the wrong rows.
💡 See the solution▼
Quoting numbers that should be bare, or text that should be quoted
A list of numeric IDs wrapped in quotes may force the database to convert types, and a list of text values with no quotes is read as column names. Mixed lists make it easy to get one half wrong.
💡 See the solution▼
A comma list pasted into a spreadsheet lands in one cell
Pasting comma separated text into a spreadsheet cell puts everything in a single cell. Splitting it afterward means running a text-to-columns step by hand every time.
💡 See the solution▼
Duplicate IDs slip into a mailing or import list
A hand-built list of IDs or email addresses often repeats a value. A repeated address can mean the same person gets a message twice, and a repeated ID can trigger a duplicate-key error on import.
💡 See the solution▼
Comma separated list converter FAQ
Q.How do I convert a column to a comma separated list?
A. Copy the column in your spreadsheet and paste it into the input box with List → Comma selected. Each line becomes one item, and the result is the items joined with commas. If you copy several columns, the tool shows a button for each column so you can pick the one you want. No formula is needed.
Q.How do I make a list for a SQL IN clause?
A. Paste your values, one per line, and click the SQL IN clause preset. Each item gets single quotes and the whole list gets parentheses, like ('A', 'B', 'C'). An apostrophe inside a value is doubled, so O'Brien becomes 'O''Brien', which is how standard SQL writes it.
Q.How do I keep numbers unquoted in the list?
A. If every value is a number, use the SQL IN (numbers) preset. For a mixed list, pick a quoting preset and turn on Leave numbers unquoted. Plain numbers such as 42 or -3.5 stay bare and everything else is quoted. A value with a leading zero, like 007, counts as text and stays quoted.
Q.Can I turn a comma separated list back into one item per line?
A. Yes. Select Comma → List and paste the text. Each item goes on its own line. If the whole input is wrapped in one pair of parentheses or brackets, such as a SQL IN list, the wrapper is removed first. A leading IN or NOT IN is removed too.
Q.What if my values contain commas?
A. In Comma → List mode, a value inside double or single quotes keeps its commas, so "Austin, TX" stays one item. Two quotes in a row inside a quoted value are read as one literal quote. A quote starts a quoted value only at the beginning of an item, and a quoted value cannot continue onto the next line.
Q.How do I make a Python list or JSON array?
A. Click the Python list or JSON / JS array preset. Python gets single quotes and JSON gets double quotes, both inside square brackets. Quotes and backslashes inside a value are escaped with a backslash, which keeps the output valid in both.
Q.Can it remove duplicates and sort the list?
A. Yes. Turn on Remove duplicates to drop repeated items. Items are compared after trimming spaces, and case matters, so Apple and apple are different items. The result panel shows how many duplicates were removed. The Sort option puts items in A to Z or Z to A order, ignoring case, with numbers in natural order so item2 comes before item10.
Q.Is my data sent to a server?
A. No. The conversion runs as JavaScript in your browser, and the tool has no upload step. Your text is held only in the page while it is open, and closing or reloading the page clears it.
Q.Is there a limit on the number of items?
A. The tool sets no limit. The result is recalculated whenever you change the input or an option, so a very large paste can feel slower on an older device. Databases have their own limits, though. Oracle accepts at most 1,000 items in an IN list.
Your feedback
makes this tool better.
Tell us which features you'd like, what should be fixed, or which new tool you'd like to see. An engineer reads every submission and uses it to guide development.