RunTheTests
/

Remove Line Breaks

Join wrapped text into a single flowing line.

What you provide

How this calculation works

Every line break is replaced with a single space and surrounding whitespace tidied, turning hard-wrapped text back into flowing paragraphs.

What the results mean

Spaces, not nothing
Breaks become spaces so words do not run together — "line one\nline two" becomes "line one line two".
Paragraph breaks kept
Blank lines are treated as deliberate paragraph boundaries and survive, so a hard-wrapped document comes back as flowing paragraphs rather than as one continuous block.
Hyphenation
A word split across a line break with a hyphen is left as it is. Rejoining those automatically would corrupt genuinely hyphenated compounds, so it is a judgement the tool leaves to you.

Common problems and fixes

Text copied from a PDF is broken at every line
That is exactly what this fixes. PDFs store text positioned line by line with no notion of a flowing paragraph, so copying produces a hard break at the end of every visual line. Joining them restores prose you can paste into a document or an email without reflowing it by hand.
Everything collapsed into one enormous paragraph
The source used single line breaks between paragraphs rather than blank lines, so there was nothing to distinguish a wrap from a paragraph boundary. Add a blank line between paragraphs in the source before running the tool, or split the result back into paragraphs afterwards.
Words from a PDF are stuck together
Some PDFs break lines without a trailing space, so joining them butts the last word of one line against the first of the next. Each break is replaced with a space here precisely to avoid that. If words are still running together, the space was missing inside the original line rather than at the break.

Frequently asked questions

Will it join words together?

No — each break becomes a space, so words stay separated. That is the difference from simply deleting the newline character.

What happens to double line breaks?

They are preserved as paragraph breaks. The distinction is the whole point of the tool: a single break is nearly always a wrap that some application inserted, while a blank line is a boundary the author intended, so removing the first and keeping the second is what turns hard-wrapped text back into readable prose.

Can it fix text wrapped by an email client?

Yes, and that is one of the most common uses. Plain-text email is traditionally wrapped at around 72 characters, so quoting or forwarding produces text that reflows badly everywhere else. Joining the lines and letting the destination wrap it naturally is the fix, and it takes one step rather than a manual pass.

Put this on your own site

Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.

Embed code
<iframe src="https://runthetests.com/embed/remove-line-breaks/" width="100%" height="560" style="border:1px solid #e5e5e5;border-radius:8px" title="Remove Line Breaks" loading="lazy"></iframe>

Preview it at https://runthetests.com/embed/remove-line-breaks/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.

More in Text