How to clean text copied from a PDF without losing meaning

Repair line breaks, rejoin hyphenated words and recover paragraph order. Three examples you can copy and a check for OCR scans.

Check whether you can select text

Try selecting and pasting a sentence into a plain-text editor. If you get readable characters, work from that copy. If the page is only an image or the extracted text is unusable, try optical character recognition (OCR) with the document language. Compare names, numbers and accents against the original.

Try three sample extracts

Paste one extract at a time. Join lines inside a paragraph with a space. Manually rejoin words hyphenated at line endings and keep hyphens that belong to the word. For two columns, go back to the PDF and copy the left column before the right if that is the intended reading order.

Before After
The library
closes at six.
The library closes at six.
The docu-
ment is ready.
The document is ready.
Hours Tickets
Opens at nine. Free entry.
Hours
Opens at nine.

Tickets
Free entry.

Check before pasting into the final document

Keep the original extracted text. Use the line-break tool on one paragraph at a time and preserve lists and blank lines between sections. If a table comes out in the wrong order, check headings and units in the PDF before transferring values. Read across page breaks, where headers or page numbers can enter the text.

Remove line breaks

More articles