Make a Comma Separated List

Turns a column of items (one per line, like a spreadsheet column) into a, b, c, or splits a comma separated list back into lines.

Advertisement

How to use it

  1. Paste your list. Copying a column from Excel or Google Sheets gives one item per line, which is exactly right.
  2. Press Lines → commas. To go the other way, press Commas → lines.
  3. Press Copy.

Quotes for SQL, code and CSV

Choose Wrap items in to put quotes around every item:

  • 'single quotes' for a SQL IN (...) list. Apostrophes inside items are doubled (O’Brien becomes 'O''Brien'), as SQL requires.
  • "double quotes" for JSON arrays, JavaScript, Python and CSV.

Even without that option, any item that already contains a comma is wrapped in double quotes, so “Smith, John” stays one item instead of becoming two. The same rule is used when splitting: "Smith, John", apple splits into two items, not three.

Other separators

Need tabs, pipes or something else? The full editor can convert between any two separators and sort at the same time.

A column to a comma separated list

Before
apple
banana
cherry
After
apple, banana, cherry

Back to one item per line

Before
red, green, blue
After
red
green
blue

With single quotes, ready for SQL

Before
1001
1002
O'Brien
After
'1001', '1002', 'O''Brien'

Questions

How do I turn a comma separated list into a column in Excel?

Press Commas → lines here, copy the result, and paste it into a single cell in Excel. Each item lands in its own row.

Can I sort the list too?

Yes. Alphabetize can sort and change the separator in one step: set “Separate results with” before pressing A → Z.

What if my list uses semicolons?

They’re detected automatically when the list is on one line. You can also choose Semicolons under “Items are separated by”.