
How to Remove Line Breaks From a PDF
Why text copied from a PDF breaks after every line, and how to rejoin paragraphs in a text editor or Word without losing the real paragraph breaks.
Copying text out of a PDF and getting a line break after every line is not a bug in your clipboard. It reflects what the file actually contains: a PDF has no paragraphs, only text positioned line by line, and extraction converts each of those positioned lines into a line of text.
Why it happens
When a PDF is created, a paragraph is laid out as a series of separate text-drawing operations, one per visual line. There is no marker saying "these five lines are one paragraph". Extraction therefore has to guess where paragraphs begin, and most tools do not try — they emit what they find, one line at a time.
Two-column layouts make it worse, because the extraction order follows drawing order rather than reading order.
Fixing it in a text editor
The reliable approach is a regular expression that joins lines which do not end in sentence-ending punctuation:
- Find:
([^.!?:;])\n(?=[a-z]) - Replace:
$1
That joins a line to the next only when the first does not end a sentence and the next begins lowercase — which preserves genuine paragraph breaks while removing the artificial ones. Most editors (VS Code, Notepad++, Sublime) support this with "regular expression" enabled.
For text with hyphenated words split across lines, run this first:
- Find:
(\w)-\n(\w) - Replace:
$1$2
In Word
Paste the text, then Find and Replace with Use wildcards off: search for ^p (paragraph mark) and replace with a space, but only after protecting genuine paragraph breaks — replace ^p^p with a placeholder first, then ^p with a space, then the placeholder back to ^p^p. Clumsy, and it works.
The better fix when it is available
If you control the source document, export the PDF with tagged structure enabled. A tagged PDF records that a run of lines is one paragraph, and extraction from it keeps paragraphs intact. This also makes the document accessible to screen readers, which is worth doing regardless. The PDF accessibility checker reports whether a document is tagged.
If you are editing rather than extracting
You may not need to extract at all. If the goal is to change the text and keep the document, editing it in place avoids the round trip entirely — and with it, the whole line-break problem.
Frequently asked questions
Why does every line become a separate paragraph? Because that is how the text is stored — positioned line by line, with nothing marking paragraph boundaries.
Does this happen with every PDF? Tagged PDFs preserve paragraph structure and extract cleanly. Most PDFs are untagged.
Why is the text order scrambled as well? A multi-column layout. Extraction follows drawing order, not reading order — select one column at a time.
Will OCR fix it? Not usually. OCR adds a text layer with the same line-by-line structure, so the same problem appears.



