List to Comma Separated

Convert a list into comma-separated values, or split a comma-separated list into lines.

Wrap items in
0 words · 0 charactersNot uploaded

Column to comma-separated, and back

Copy a column from a spreadsheet and you get one item per line. Many places want a comma-separated list instead: SQL IN (...) clauses, tag fields, email “To” lines, code arrays. Paste the column and choose how to join it, or go the other way and split a comma-separated list into lines.

Auto splits on new lines, commas, semicolons and tabs at once, which handles most messy input. You can also split on spaces, pipes or any custom delimiter.

Output options

  • Join with a comma and space, a bare comma, new lines, semicolons, tabs, spaces, pipes or anything you like (use \n for a new line).
  • Wrap items in double or single quotes for code and SQL: 'apple', 'banana'. Quotes inside items are escaped.
  • Remove duplicates keeps the first copy of each item.

Items are trimmed and empty entries dropped automatically.

Worked example

Here is what the List to Comma Separated returns for its built-in example. Settings used: Split input by: Auto (lines, commas, tabs); Join output with: Comma + space; Wrap items in: Nothing. Click Try an example in the tool above to load it, then change it as you like.

Input
apple
banana
cherry
date
Output
apple, banana, cherry, date

Related tools: Add Prefix & Suffix to Lines, Remove Duplicate Lines.

Questions

How do I convert a column to a comma-separated list?

Paste the column (one item per line). The output joins the items with commas. Add quotes if you need them for SQL or code.

How do I split a comma-separated list into lines?

Paste the list, keep “Auto” or choose “Commas” as the input delimiter, and set output to “New lines”.

Last reviewed · How Textkiln tools work