Skip to content

Replace line breaks with commas

Paste a list with one item per line and get one line back, with a comma and a space between items. Blank lines are left out.

Free, no sign-up. Runs in your browser. Nothing you type or upload is sent to us or stored.

At a glance

Separator
Comma and space (", "); type "," for no space, or any other separator
Excel formula
=SUBSTITUTE(A1, CHAR(10), ", ") swaps the line breaks inside cell A1 for commas
Source: support.microsoft.com, checked 2026-11
Line break in Excel
CHAR(10) is the line feed character; Excel for the web supports it too
Source: support.microsoft.com, checked 2026-11
Google Docs
In Docs, \n typed into Replace with is inserted as literal text, so find and replace can't do this there
Source: support.google.com, checked 2026-11

Share the clean text as a link

Paste the result into Liite's quick paste and get a short link you can send to anyone. No account needed.

Paste and share

Replace line breaks with commas: what to know

This page starts the remove line breaks for this case. For every option and how to use it, see the remove line breaks.

Lists this is good for

Email addresses copied from a spreadsheet column, to paste into the To field of an email. Product codes or order numbers for a search box that takes a comma-separated list. Tags, keywords or hashtags for a form. The example on the page is a column of email addresses with one empty row in it.

Doing it in Excel or Word instead

In Excel, the line breaks inside a cell are the character CHAR(10). The formula =SUBSTITUTE(A1, CHAR(10), ", ") returns the cell's text with each break swapped for a comma and a space. For a whole column, TEXTJOIN does the joining: =TEXTJOIN(", ", TRUE, A1:A20) skips empty cells.

In Word, open Replace, put the paragraph mark from the Special menu in Find what, and type a comma and a space in Replace with. Check the result: Word also replaces the break at the end of the last item, which leaves a stray comma.

Questions

How do I replace new lines with commas?

Paste the list in the box. Each line break becomes a comma and a space, and blank lines are skipped. Copy the result.

How do I replace line breaks with commas in Word?

Use Replace (Ctrl+H), choose Paragraph Mark from the Special menu for Find what, type ", " in Replace with, then Replace All.

Can I use a different separator?

Yes. Change the separator field to a semicolon, a pipe or anything else. \t gives a tab.