Column to Comma Separated List

Join one-per-line values into a single comma delimited line, with presets for SQL IN lists, JSON arrays and Python lists.

Presets:
0 lines

Or drop a .txt file onto the box above.

0 items
Separator
Wrap each item
Wrap whole list
Clean up
Transform

How to use

  1. Paste your column. It can come from Excel, Google Sheets, a SQL result, a log file or any text editor; each line is one item.
  2. Pick an output shape. Click a preset chip (SQL IN, JSON array, Python list…) or set the separator and wrappers by hand in the options panel.
  3. Tidy the list if you need to. Remove duplicates, sort A–Z or numerically, change the letter case, or reverse the order.
  4. Copy or download. The result updates as you type; Ctrl+Enter in the input box copies without reaching for the mouse.

Example: what each preset produces

Starting from the three-line column apple, banana, cherry, each preset gives you a different, ready-to-paste result:

PresetOutputTypical use
No spacesapple,banana,cherryCSV cells, URL query strings
Plainapple, banana, cherrySentences, emails, tags fields
SQL IN('apple', 'banana', 'cherry')WHERE id IN (…) clauses
JSON array["apple", "banana", "cherry"]API payloads, config files
Python list['apple', 'banana', 'cherry']Scripts and notebooks
Semicolonapple; banana; cherryOutlook / Exchange recipient lists
Pipeapple | banana | cherryMarkdown tables, log filters
Regex OR(apple|banana|cherry)Alternation patterns in search tools

Common situations where this saves time

Building a SQL IN list

You have a column of IDs from a report and need to query those exact rows. Paste the IDs, click SQL IN, and drop the result straight after WHERE id IN. Each value becomes a quoted string, and a quote inside a value is doubled, so a name like O'Brien stays one value instead of ending the string early. For numeric IDs you may prefer no quotes at all; use the Plainpreset and wrap the whole list in parentheses:

SELECT * FROM orders WHERE customer_id IN (1042, 1043, 1044);

Addressing an email to a list of people

Most mail clients accept addresses separated by commas; Outlook traditionally expects semicolons. Paste the address column, choose the matching preset, and paste the result into the To or BCC field. Tick Remove duplicates first so nobody receives the message twice.

Turning spreadsheet rows into code

Product SKUs, country codes, feature flags: data often starts life in a spreadsheet and needs to end up in an array. The JSON array and Python list presets add the right quotes and brackets so the result parses on the first try; paste the result into the JSON Formatter if you want it validated.

Options explained

Edge cases and common errors

Do the same job in a spreadsheet or in code

Excel and Google Sheets

The TEXTJOIN function joins a range with a separator and can skip blank cells:

=TEXTJOIN(", ", TRUE, A1:A100)

To add quotes around every value, wrap the range in a text expression first:

=TEXTJOIN(", ", TRUE, "'" & A1:A100 & "'")

Python

lines = [l.strip() for l in text.splitlines() if l.strip()]
result = ", ".join(lines)

Command line

paste -sd, column.txt          # Linux / macOS
(Get-Content column.txt) -join ", "   # PowerShell

Column to Comma Separated List FAQ

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser with JavaScript. Nothing you paste is sent to a server, stored, or logged. You can disconnect from the internet after the page loads and it will keep working.

Is a comma separated list the same as a comma delimited list or a CSV?

“Comma separated” and “comma delimited” mean the same thing: values with a comma between them. A CSV file is many such lines, one per row, so the single line this tool produces is exactly one CSV row. The difference shows up when a value itself contains a comma: CSV puts that value in double quotes ("Smith, John"), which you can do here by typing " into both the Before and After boxes under “Wrap each item”. The SQL IN, JSON array and Python list presets fill those boxes for you.

Can I use a separator other than a comma?

Yes. The separator menu includes semicolon, pipe, space, tab and new line. Pick Custom… to type anything else, such as -- or :: .

Why does the item count say some lines were dropped?

Blank lines are skipped by default, and duplicates are removed when that option is ticked. The counter tells you how many lines did not make it into the output so nothing disappears silently. Untick “Skip blank lines” to keep them.

Does it work with data copied from Excel or Google Sheets?

Yes. Select a column in your spreadsheet, copy it, and paste here. Each cell becomes one line, which is exactly what the converter expects. Trailing spaces from cells are trimmed automatically.

How do I go the other way, from a comma list back into a column?

Use the companion comma separated list to column tool, or click Split back to column under the result box, which opens that tool with your list already loaded.

Runs entirely in your browser: this page is a static file with no server behind it, so nothing you paste can be uploaded. Last reviewed by Parthesh Gupta.