Remove line breaks

Turn a wrapped block into one flowing line: every line is trimmed, blanks are dropped and the rest is joined with a single space.

Output
Enter text to see output.

What to know

This operation takes text that was broken into short lines, as happens when you copy from a PDF, an e-mail or a terminal, and flows it into a single line. Each line is trimmed, empty lines are dropped, and the remaining lines are joined with exactly one space.

The lines Dear Sam, then thank you, then an empty line, then for the help. become Dear Sam, thank you for the help. Because empty lines vanish, paragraph breaks vanish too, so a multi-paragraph text ends up as one long paragraph; split it again by hand where you need breaks.

The joiner is always a space, which suits English and Spanish but needs care elsewhere. Japanese and Chinese lines gain a space where each break was, and a word hyphenated across a line end, such as inter- and national, becomes inter- national. Fix those two cases afterwards with find and replace.

When you want a comma, a pipe or no gap at all between the joined lines, use join lines instead, which has a separator field. This one has no options and is the quick choice for pasting a wrapped paragraph into a form or a chat box.

Choose a specific task 10
Related tools 4
How to use Remove line breaks
  1. Copy a wrapped paragraph from a PDF, such as 6 lines of 70 characters, and paste it into the Text input box.
  2. Read the Output panel and check that the paragraph became one continuous line with single spaces.
  3. Look for words split by hyphens at the old line ends and repair them with find and replace.
  4. Copy the line into your form, chat box or document.

Quick answers

Does it keep paragraph breaks?

No. Blank lines are dropped like any other empty line, so separate paragraphs are merged into one. Add the breaks back by hand afterwards.

Why does my Japanese text have spaces now?

Lines are always joined with a space, which Japanese and Chinese do not use. Remove them with find and replace, entering one space in Find and leaving Replace with empty.

What happens to a word hyphenated at the end of a line?

The hyphen stays and a space follows it, so inter- and national become inter- national. Replace the hyphen-plus-space combination to repair it.

Can I choose what goes between the lines?

Not here. Use join lines to pick a comma, a pipe or an empty separator.