Comma Separator

Turn a column or list into comma-separated values (and back)

Convert a list with one item per line - such as a column copied from Excel - into a comma-separated list, with optional quotes for SQL IN (...) lists, duplicates removed and sorting. Or split comma-separated text back into lines.
Try an example:

Output will appear here...

About Comma Separator

How it works

  1. Your list is split into items (by new lines unless you choose otherwise), and each item is trimmed.
  2. Empty items and, if you like, duplicates are removed and the items can be sorted.
  3. Items are joined with commas - optionally wrapped in quotes, with quotes inside items doubled as SQL and CSV expect.

What you need

  • A list - one item per line, or separated by something else you choose.

Tips

  • SQL: choose single quotes to get 'a','b','c' ready for WHERE id IN (...).
  • To go the other way, set "Items are separated by" to Comma and "Join them with" to New lines.
  • For prefixes, suffixes and more separators, use the full Text Separator tool.

Runs in your browser. Your text never leaves your browser.

Frequently asked questions

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

Copy the column from Excel or Google Sheets, paste it here and click Run. Each cell becomes one item, joined with commas.

How do I add quotes around each item?+

Choose single or double quotes under "Wrap each item in". Single quotes are what SQL needs for text values.