Lines to Comma-Separated List

Turn one column of lines into a comma, quoted or semicolon list, with cleanup. Your text never leaves your browser.

How do I join an Excel column with commas?

Paste one item per line and get a comma or quoted list.

How to use it

  1. Copy a column from Excel or Google Sheets and paste it above. Each cell becomes one line.
  2. Pick a separator and quotes. Comma + space gives a, b, c; single quotes with a comma give 'a','b','c'.
  3. Choose whether to drop blank lines, extra spaces and duplicates, then copy the result. It updates as you change options.

What it is for

Examples

The input is five lines: " apple / pear / (blank) / apple / grape ". The values below were produced by running this tool's own function.

SettingsResult
Comma + space, default cleanupapple, pear, apple, grape (1 blank line removed)
Comma + space, remove duplicatesapple, pear, grape
Comma, single quotes, remove duplicates'apple','pear','grape'

Things to watch

How this tool calculates

Worked example

Five lines "apple / pear / (blank) / apple / grape" joined with comma and space give "apple, pear, apple, grape" (1 blank line removed). With duplicate removal on you get "apple, pear, grape", and with single quotes, comma and duplicate removal you get 'apple','pear','grape'. These values were produced by running this tool's own function.

Things to know before you use it

The full counting rules and the sources for service limits are on Methods and standards.

Frequently asked questions

How do I join a column from Excel with commas?

Select the cells in Excel, copy them and paste into the box above; each cell becomes one line. Keep the separator on "Comma + space" and the result appears below as a, b, c. Use the copy button to take it away.

How do I build a list for a SQL IN condition?

Choose "Comma", "Single quotes" and tick "Wrap in ( )" to get ('1001','1002','1003'). A single quote inside a value is doubled to '' so the statement does not break. For a numeric column set quotes to "None".

What separator does an email recipient box need?

Many mail programs accept both commas and semicolons, but not all. Outlook usually expects semicolons (a@x.com; b@x.com) while Gmail prefers commas. With a long list, try a few addresses first.

How are duplicates removed?

After trimming spaces, only lines that are exactly equal count as the same value. Case matters, so Apple and apple are different; the first line is kept and the order does not change. To merge them ignoring case, first use Change Text Case.

Is my list sent to a server?

No. The conversion is calculated inside this page and your list is never stored or sent anywhere.

More text tools