Text Transform

Remove line breaks

What to do

Transformed in your browser · nothing is uploaded

Local · hyphenated line splits need a manual fix
Advertisement
320 × 100

Joins every line into one paragraph: each line is trimmed, blank lines are dropped, and what is left is joined with a single space. It is the standard repair for text copied out of a PDF, where every visual line arrives as a hard line break.

How to use the remove line breaks

1 Paste the broken-up text.
2 Join into one paragraph is the default; Join with commas uses the separator field.
3 Repair any word that was hyphenated across a break.
4 Copy the paragraph back into your document.

A PDF has no concept of a paragraph. It positions glyphs on a page, so copying reconstructs breaks from wherever the lines happened to fall, and pasting that into something with its own wrapping gives you a ragged column that reflows badly. Plain-text email does the same thing for a different reason: it is hard-wrapped at around 72 columns before sending — and so does anything copied out of a terminal. Joining the lines puts the paragraph back together so the text can wrap to whatever width it lands in.

Two things the join cannot know. A hyphen at the end of a line might be a word split across the break or a real hyphen, and there is no way to tell inter- + national from well-known, so hyphens are always kept and split words need a pass with find and replace. And every break goes, the genuine paragraph ones included: join one paragraph at a time if the structure matters. Note also that joining only trims the ends of each line; runs of spaces inside a line survive it, which is why the clean option is worth running first.

Questions

A PDF stores positioned glyphs rather than paragraphs, so a copy turns the visual line endings into real breaks.

MDN, working with strings
Advertisement
300 × 250
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding