text · 7 min read

How to copy text from a PDF without the line breaks

Every line becomes its own paragraph. The text will not reflow. And fixing it by hand takes longer than retyping the page, which is what most people end up doing.

You select three paragraphs from a PDF, paste them into a document, and get forty paragraphs — one for each printed line. Change the margin and nothing reflows, because as far as the document is concerned each line is a finished thought.

A PDF has no paragraphs

This is the whole explanation, and it is worth accepting rather than fighting.

A PDF page does not contain paragraphs, lines, or sentences. It contains text drawn at coordinates: this string at this position, in this font, at this size. The layout was decided by whatever produced the file, and then thrown away. What remains is the result.

So anything copying out of a PDF has to guess where the structure was. The only reliable signal available is that the vertical position changed between one string and the next, which means a new line — and a new line is all it can honestly report. Whether that line ended a paragraph or merely ran out of page width is not recorded anywhere.

Faced with that, extractors emit a break at every line. It is the conservative choice: too many breaks is recoverable, and silently joining two paragraphs is not.

Why fixing it inside Word goes wrong

The usual attempt is find-and-replace on paragraph marks, and it produces one enormous block of text, because it removes the breaks you wanted along with the ones you did not.

The refinement — replace two marks with a placeholder, remove the remaining single marks, restore the placeholder — works when the PDF used blank lines between paragraphs and fails when it used indentation instead, which is most books and most reports.

It also has to happen after the text is already in Word, where the breaks are real paragraph objects carrying styles. Doing it before is easier, which is the actual advice: paste somewhere plain, fix it there, then move it.

What a correct join looks like

The rule that gets it right almost every time is short: join a line to the next one unless it ended in a full stop, question mark, exclamation mark or colon.

A line that ran out of width ends mid-sentence, so it ends in a word or a comma. A line that ended a paragraph ends in sentence punctuation. That single test separates the two cases in ordinary prose.

Two refinements make it reliable. A blank line is always a real paragraph break, so preserve it. And a line ending in a hyphen is a hyphenated word split across lines — join it and delete the hyphen, which no general rule about punctuation would catch.

A line-break remover that offers a paragraph-aware mode is applying exactly this. One that only offers "remove all breaks" will give you the single-block result, which is occasionally what you want and usually is not.

The other things that come across

Hyphens inside words. As above. They are indistinguishable from real hyphens once the lines are joined, so remove them during the join rather than after.

Page numbers and running headers. They sit at coordinates like everything else, so they arrive in the middle of your text at every page boundary. Nothing detects them automatically with any reliability; delete them by hand, which is quick once you know to look.

Ligatures. fi and fl are drawn as single glyphs in most serif fonts and sometimes come back as one odd character or as nothing at all.

Invisible characters. Non-breaking spaces in particular, which then break your searching later — a separate problem with the same symptoms.

Wrong reading order, in anything with columns, sidebars or a table. This one has no clean fix, because the order is genuinely not in the file.

When there is nothing to copy at all

If selecting a word highlights the entire page, or highlights nothing, the document is a scan and there is no text in it to break. That is a different problem with a different answer, covered in why you cannot copy text out of a PDF.

The sequence that works

Copy from the PDF, or extract the whole document at once if you want more than a page — dragging across page boundaries is where most of the frustration lives.

Remove the line breaks with paragraph detection on. Check the joins around anything that was a list or a heading, because those are the cases the punctuation rule cannot see. Then paste into your document.

Two steps instead of one, and it is faster than any amount of find-and-replace afterwards.

Questions

How do I copy text from a PDF to Word without the line breaks?

Paste it somewhere plain first, remove the line breaks there, then move it into Word. Pasting straight into Word carries the breaks in as real paragraph marks, and removing them afterwards means find-and-replace on paragraph marks — which also joins the paragraphs you wanted to keep.

Why does a PDF break every line in the first place?

Because a PDF has no lines and no paragraphs. It has text positioned at coordinates. Whatever copies from it has to infer where a line ended from where the next piece of text was drawn, and the only thing it can say for certain is that the vertical position changed — so it emits a break there.

How do I keep the paragraph breaks but lose the line breaks?

Join lines only where the previous one did not end in sentence punctuation, and treat a blank line as a real paragraph break. A remover that offers "smart" or paragraph-aware joining does this; a plain one deletes every break and runs the whole document into one block.

Why are there hyphens in the middle of words after pasting?

The PDF was typeset with hyphenation, so a word was split across two lines with a real hyphen character. Joining the lines leaves the hyphen inside the word. Remove a hyphen that sits immediately before a join, and only there — the ones in genuinely hyphenated words look identical.

Why does the text come out in the wrong order from a two-column PDF?

Extraction follows the order the text was drawn, which for two columns is often left column then right column, and sometimes alternating. There is no reliable fix at the text level. Copy one column at a time, which most readers allow with a rectangular selection.

Tools from this guide