Skip to content

Turn a column or list into comma-separated text in one paste

Published

Open Remove line breaks

Copy the column or list, paste it into remove line breaks, and choose Comma under Replace each line break with. Each line becomes one item in a single line, separated by a comma and a space, ready to copy.

Steps

  1. Copy the items. From a spreadsheet, select the cells in one column and copy; each cell arrives on its own line.
  2. Paste into Text with line breaks.
  3. Under Replace each line break with, choose Comma.
  4. Leave Paragraphs on One block so the whole list becomes one line.
  5. Leave Extra spaces on Tidy spaces, which trims spaces around each item.
  6. Press Copy.

Example. This list:

alex@example.com
priya@example.com
sam@example.com

becomes:

alex@example.com, priya@example.com, sam@example.com

Blank lines in the list are skipped, so a stray empty cell does not leave two commas in a row.

Choosing the separator

Comma puts a comma and a space between items. When a different separator is needed, choose Custom and type it in the box that appears. It starts as a vertical bar with a space on each side.

Where the list goes What to choose or type Result
Most email "To" fields Comma a@x.com, b@x.com
Some email apps and spreadsheet formulas Custom: a semicolon, then a space a@x.com; b@x.com
A comma list with no spaces, such as tags or IDs Custom: a comma alone red,green,blue
A readable inline list Custom: space, slash, space red / green / blue
One long string Nothing redgreenblue

The custom text is placed exactly as typed, spaces included, so a comma alone and a comma followed by a space give different results.

Quotes for SQL and code

The tool joins lines; it does not add quotes around each item. For an SQL IN (...) list of text values, choose Custom and type a quote, a comma, a space and a quote. The result has quotes between the items:

alex', 'priya', 'sam

Add the opening ' and closing ' by hand, and wrap it in brackets: ('alex', 'priya', 'sam'). Numbers need no quotes; Comma alone gives 101, 102, 103.

Several lists at once

To join several groups separately, separate them with a blank line in the box and choose Keep paragraphs. Each group becomes its own comma-separated line, with a blank line between the groups.

Tidy the items first

  • Mixed capitals: run the list through the case converter first. Its writing cases work line by line and keep the line breaks.
  • Tags or file names that must be plain lower case with no spaces: the slug generator turns one item per line into a slug per line. Then join those here.
  • Duplicates: this tool does not remove repeated items. Remove them in the spreadsheet before copying.

Going the other way

To split a comma-separated line back into a list, use your spreadsheet's split-text-to-columns feature or the find-and-replace in a text editor. This tool only removes line breaks; it does not add them.

Questions

How many items can I paste?

There is no set limit. Long lists are joined in your browser on your device.

Why are there spaces after my commas?

Comma adds a comma and a space, which reads well in emails and documents. For no space, choose Custom and type a single comma.

Is the list uploaded?

No. It is processed in your browser and stays on your device, which matters for lists of email addresses or customer IDs.

Can I keep the original list?

Yes. The pasted list stays in the top box, and changing a setting updates the result straight away.

Remove line breaks

Join lines from a PDF or email with a space, comma or your own text.

Open Remove line breaks