WordRoom Privacy

Clean up

Remove line breaks

Join lines broken by a PDF column or an email client, while keeping genuine paragraph breaks.

Why PDF text pastes broken

A PDF does not store paragraphs. It stores glyphs at coordinates. When you select text in a PDF viewer and copy it, the viewer reconstructs a reading order and inserts a line break wherever the visual line ended — which is the edge of the column, not the end of the sentence. Paste that into a document and every line stops early.

Email clients cause the same problem differently. Plain-text email traditionally hard-wraps at around 72 characters, so forwarded text arrives pre-broken. Code editors with a fixed ruler do it too.

The fix is to distinguish two kinds of break. A single newline inside a paragraph is an artefact and should become a space. A blank line between paragraphs is meaningful and should survive. "Keep paragraph breaks" does exactly that; switch it off only when you genuinely want everything on one line.

The cleanup order that works

When text arrives badly formatted, the order of operations matters. Running these in the wrong sequence leaves seams behind.

  1. Remove invisible characters first. Zero-width spaces and byte-order marks survive most other operations and break search later.
  2. Trim each line, so trailing spaces do not become double spaces when lines join.
  3. Remove the line breaks, keeping paragraph breaks.
  4. Collapse extra spaces to tidy the joins.
  5. Remove empty lines last, once you can see the real structure.

Hyphenation is the case this tool deliberately does not guess at. PDFs often break a word across lines with a hyphen. Rejoining "compre-" and "hension" automatically would also destroy genuine hyphens in "state-of-the-art", so the safe behaviour is to leave them and let you search for remaining hyphens yourself.

Common questions

Why does text copied from a PDF have breaks everywhere?

A PDF stores glyph positions, not paragraphs. When you copy, the viewer inserts a line break wherever the visual line ended — the edge of the column, not the end of the sentence. The structure was never in the file to begin with.

Will it destroy my paragraph breaks?

Not with "Keep paragraph breaks" on, which is the default. Single newlines inside a paragraph become spaces; blank lines between paragraphs survive. Switch it off only when you deliberately want everything on one line.

Does it rejoin words hyphenated across lines?

No, deliberately. Rejoining "compre-" and "hension" would also destroy genuine hyphens in words like "state-of-the-art", and there is no reliable way to tell the two apart without a dictionary. Search for remaining hyphens after cleaning.

Related tools