Fixing broken line breaks in text copied from a PDF
Paste text copied from a PDF and every visual line ends in a hard return. The fix is understanding why, then reflowing the lines back into paragraphs.
Why every line breaks
A PDF does not store sentences — it stores visual lines of text positioned on a page. A paragraph rendered as five lines comes out as five short lines, padded with the spacing that justified the columns. Paragraph boundaries get lost entirely.
Fixing it by hand
- Find & replace in Word: replace
^p(paragraph mark) or^l(manual line break) with a space. To keep real paragraphs, first replace double marks^p^pwith a placeholder, then swap it back at the end. - Regex in an editor: replacing
\n(?!\n)with a space removes intra-paragraph breaks while keeping the blank lines that separate paragraphs.
Both work but require memorizing rules — and each document breaks a little differently.
Clean it in one paste
This tool reflows text the moment you paste: it keeps paragraphs separated by blank lines, stitches back lines that were cut mid-sentence, and leaves list or note-style lines — the ones that don't end in sentence punctuation — on their own lines. You can then output the result as two sentences per paragraph, one sentence per paragraph, or the original paragraphs.
Worth knowing before you copy
- Two-column papers and magazines copy columns interleaved. Selecting one column at a time produces dramatically cleaner text.
- Tables come out as cells listed in reading order; the grid has to be rebuilt by hand afterward.
- Scanned PDFs are images — there is no text to copy until an OCR step extracts it.