Getting text out of a PDF without losing your mind
Why some PDFs hand over clean text and others return nothing, how column layouts scramble the order, and when OCR is the only honest answer.
2026-12-01
A PDF is a container, not a text file
A PDF holds pages made of drawing instructions: put this glyph at these coordinates, draw this line, paste this image. When the file was exported from Word, Google Docs or a reporting system, those glyphs are real characters and the document has a text layer. When it came from a scanner or a photo, the page is one large image and there are no characters at all — only pixels that look like letters.
The fastest test does not require any tool. Open the PDF and try to select a single word with the mouse. If the selection follows the words, you have a text layer and extraction will work. If the cursor draws a rectangle around the whole page, or the text appears only after a slow rendering step, it is a scan. No amount of extraction will produce characters from an image; that job belongs to OCR, which guesses characters from shapes and always carries an error rate.
Why the order comes out wrong
Extraction does not return paragraphs. It reads a stream of characters with positions, and the order in that stream is whatever the producing software decided to write. A two-column newsletter may be stored left column first, or row by row across both columns. Tables are especially fragile: cells are just characters at coordinates, so a price can end up next to the wrong product name.
Tools that rebuild lines — grouping characters by vertical position and inserting a break when the baseline changes — handle ordinary one-column pages well. When a page is multi-column, extract it alone and check the first lines before trusting the rest. If the text is badly scrambled, the practical options are to copy the page manually in a viewer, or to convert the PDF to images and run OCR with layout detection, which is slower but more faithful for complex tables.
Hyphens, ligatures and glued words
Typesetting introduces artefacts that plain text cannot represent. A word broken across two lines arrives as two fragments with a hyphen, and a ligature such as fi may come out as a single unusual character. Justified text can also place each word as a separate run with no space, so a naive extraction produces sentenceslike this.
The fix is boring but reliable: after extracting, search for the pattern of a hyphen followed by a line break and remove it, then search for the most common glued words in your document and replace them. Doing this for a 40-page report takes a few minutes; retyping takes an afternoon. Keep the original PDF next to the text file so you can verify any sentence that looks suspicious.
Scanned pages need OCR, and OCR is not magic
If a page has no text layer, the only route is optical character recognition. A clean 300 DPI scan of printed text usually converts well, but handwriting, low-resolution phone photos, faded faxes and complex tables are where accuracy drops. Expect to proofread names, numbers, invoice totals and anything that matters legally; those are exactly the characters OCR confuses most often.
It also helps to know what OCR cannot preserve. It generally does not reproduce bold, italics or heading hierarchy, and it may insert line breaks at the visual end of every line. If you only need to search a document or paste a paragraph into an email, that is fine. If you need the layout, keep the PDF or convert it with a tool designed for that purpose rather than expecting plain text to carry it.
Practical rules before you extract
Extract locally when the document is private. A contract, a medical letter or an internal report should not be uploaded to an unknown service just to copy a paragraph. Browser-based extraction keeps the file on the device, which is also why it works on a plane and why there is no upload wait.
Finally, keep the source. Extracted text is a derivative, and page markers are the only link back to the original pagination. If you are quoting or citing, leave the markers on while drafting and remove them only in the final copy. And if the PDF is password-protected, the password has to be removed first in a viewer you trust; no browser tool can decrypt a file without the key.