How to remove line breaks from text, Word and Excel

Copied a block of text with a hard return at the end of every line? Replace those line breaks with a space in a few seconds.

Skip the steps and do it right here: Text cleanerOpen tool

In Word

  1. Press Ctrl + H to open Find and Replace.
  2. Click More >>, then Special, then Paragraph Mark. This enters ^p.
  3. Leave Replace with as a single space.
  4. Click Replace All.

In Excel

  1. Select the cells and press Ctrl + H.
  2. Click in Find what and press Ctrl + J. A tiny dot appears.
  3. Type a space in Replace with and click Replace All.

Or use a formula in a helper column:

=SUBSTITUTE(A1,CHAR(10)," ")

In any editor with regular expressions

Turn on “regex” in Find and Replace, search for the pattern below and replace it with a space:

\r?\n

Tip: To keep paragraphs but fix broken lines, replace a single line break and leave blank lines alone. Search for two breaks first, swap them for a placeholder, then restore them afterwards.

Questions

What is the difference between a line break and a paragraph mark?

In Word, Shift + Enter adds a line break (^l), Enter adds a paragraph mark (^p). Search for the one you actually have.

Can I remove empty lines too?

Yes. Replace two paragraph marks (^p^p) with one (^p) and repeat until nothing is found.