Skip to content
Text Cleanup Tools

Text Cleanup Tools › Lists and lines

Lines to Comma-Separated List

Turn a list with one item per line into a single line, with the separator and quotes you choose.

Processed on your device. Nothing is uploaded or stored on a server.

How it works

  1. Paste your list, one item per line.
  2. Choose the separator and whether to wrap items in quotes.
  3. Copy the single-line result.

Example

Before
red
blue

 green 
black
After
'red', 'blue', 'green', 'black'

What this tool does

This is the quick way to prepare values for a SQL IN clause, an array in code, a mail-merge field or a spreadsheet formula. Each line is trimmed, empty lines are skipped, and the remaining items are joined with the separator you pick. Choosing single quotes gives SQL-style values; double quotes suit JSON or CSV. The tool does not escape quotes that already exist inside your items, so check any item that contains an apostrophe or a quotation mark before you use the output in code.

Common problems

An item with an apostrophe broke my SQL

Items are not escaped. Double any single quote inside an item before using it in SQL.

I need the reverse (split a list into lines)

Use find and replace to turn the comma into a line break, or choose a regex replace of ,\s* with \n.

Questions

Are empty lines skipped?

Yes. Blank lines are ignored and every item is trimmed.

Can I use a different separator such as a tab?

The separators offered are comma, semicolon, pipe and new line. For anything else, replace the comma afterwards with find and replace.

Does it sort or dedupe?

No. Items stay in the original order. Sort or dedupe first with the other tools.

Related tools

Last reviewed 2026-10-14.