Remove Line Breaks

Strip line breaks and clean up whitespace

Options
Result
Cleaned text appears here…

Where stray line breaks come from

Copying text out of a PDF, an email client or a terminal usually brings hard line breaks with it — a newline at the end of every visual line rather than at the end of every paragraph. Pasted into a document that wraps text itself, the result is a ragged column that will not reflow.

Replace with a space, or nothing?

Keep replace breaks with a space on for prose, otherwise the last word of one line joins the first word of the next. Turn it off when you are rejoining something that was split mid-word, such as a long token or a base64 blob.

Collapse repeated spaces is useful straight after joining lines, since indented source text often leaves runs of spaces behind. If you only want to close up vertical gaps and keep your paragraph structure, leave line breaks alone and use remove blank lines only.

Other text tools