Text and OCR

Why you cannot copy text out of a PDF, and what to do instead

Selecting text in a PDF either works or it does not, and that single test splits every broken document into cases that need completely different answers.

People describe this problem in one sentence — "I cannot copy the text" — and it covers at least four unrelated faults. In one the document has no text at all. In another the text is present and perfect but unusable. In a third the text was deliberately turned into pictures of letters. In a fourth it was there last week and a compressor threw it away.

Telling them apart takes a few seconds and decides everything that follows, including whether repair is possible at all.

The one-second test

Open the PDF, click at the start of a paragraph and drag across a single line, then paste what you selected into a plain text editor rather than into a word processor.

  • The text highlights and pastes as text. There is a usable text layer, so nothing is missing — skip to the section on garbled copy below, where the interesting failure lives.
  • Nothing highlights, or one blue rectangle covers the whole page. There is no text at all. Every page is a picture of a page, and no amount of selecting will ever produce a character from it.
  • It highlights but pastes as boxes, question marks or nonsense. The text is present and the mapping is broken. This is the case people misdiagnose as "no text", and it has a different cause and a different fix.

This test also predicts what a compressor will do. A PDF with no text layer can be rendered and re-encoded freely, which is exactly the operation that shrinks scans so well. A PDF with a text layer cannot be treated that way without destroying the thing that made it worth having.

Four ways a PDF ends up without usable text

  • It was scanned or photographed. The most common cause by a wide margin. A scanner produces one image per sheet, and the software wraps those images in a PDF. The result is a container for pictures, and nothing inside it knows that the pictures contain words.
  • The text was converted to outlines. Design and prepress workflows often replace live text with its drawn shape so the file no longer depends on a font being installed. The letters look identical because they are the same letterforms — they are simply curves now, and curves have no characters. This is the one case where the text was sacrificed on purpose.
  • A compressor rasterised the pages. Many browser-based and low-cost compressors cannot re-encode the images inside a PDF object by object, so they render each page to an image and rebuild the document from those. It works beautifully on scans and destroys text documents, and it is the usual reason a file that used to be searchable is not any more.
  • The font is embedded but carries no character mapping. The text is genuinely there as text; the file simply never records which glyph means which character. Usually the result of subsetting a font for size and writing the subset without its Unicode mapping table.

Garbled copy is a different failure from no copy

If dragging over a line produces a selection but pasting gives rows of empty boxes, question marks, or text that appears to be a different language entirely, you are looking at a mapping problem rather than a missing layer.

Here is what is happening. A PDF does not store characters in the ordinary sense. It stores glyph indices and positions, and relies on a table inside the font to say which index corresponds to which character. Embedding only the glyphs actually used is the correct, space-saving thing to do — but if the producing application writes that subset without the reverse mapping, the file still draws perfectly and simply cannot tell you what it drew.

The diagnostic takes seconds: paste the selection into a plain editor and look at exactly what came out. A word processor may silently substitute something plausible and hide the problem from you.

This is also the honest explanation for why PDF-to-Word conversion is hard, and why the tools on this site do not offer it. Rebuilding an editable document means reconstructing paragraphs, columns, tables and reading order from positioned glyphs — and the files where that matters most are frequently the files where the mapping is already broken.

What OCR is, and why it is not a browser job

Optical character recognition is the only way to create a text layer that was never there. It looks at the image of each page, works out which shapes are probably letters, and writes a text layer on top. The page image stays; the text sits over it invisibly so it can be selected and searched.

It is not something a browser tab can do well. A capable OCR engine carries language data and glyph models measured in tens of megabytes, needs pages deskewed and binarised before it starts, and still makes mistakes on poor input. A model small enough to run comfortably in a phone browser would produce text that is worse than useless: plausible enough to search, wrong often enough to mislead.

What you can do is make the input good enough that a proper OCR tool succeeds. These are the changes that actually move the result:

  • Scan at 300 dpi. Below roughly 200 dpi small type starts merging; above 400 dpi you gain almost nothing but file size.
  • Scan text in greyscale or bitonal rather than colour, unless colour carries meaning. The engine cares about contrast, not hue.
  • Straighten the sheet. Two or three degrees of skew is enough to break line detection.
  • Scan flat rather than from a bound book where you can. Curvature near the spine is the hardest thing for an engine to handle.
  • Do not over-compress before OCR. Heavy JPEG compression leaves grey fringing along strokes that the engine reads as extra characters.

If you have already pushed a poor scan through a compressor and now need the text, start again from the original scan. Re-scan if you still have the paper; if you do not, treat the compressed copy as a picture of the document rather than as its text.

What to try, by cause

What you seeWhat happenedWhat worksWhat does not
Nothing selects at allScanned or photographed pageA real OCR tool, or a re-scan with OCR switched onAny amount of compressing, cropping or rotating
Selects, pastes as boxes or odd charactersFont subset with no Unicode mappingRe-export from the original application, or OCR a rendered copyCopying harder; most repair tools cannot invent a mapping
Looks right, selects nothing, no text anywhereText was converted to outlinesRe-export from the source with live textNothing — outlines cannot be turned back into characters
Used to be selectable, is not nowA compressor rasterised the pagesGo back to the pre-compression copyRe-compressing; the text died on the first pass
Some pages select, others do notMixed origins — some scanned, some exportedOCR only the scanned pages, then mergeTreating the whole file as one kind

Keeping the text layer when you squeeze a file

  • Compress a copy, never the only copy. If the result loses its text, you have lost nothing but a little time.
  • Test the output the same way you tested the input — drag over a line and paste it somewhere plain. It takes two seconds and catches the failure before you send the file.
  • If the document is text-heavy, reduce size by removing pages, cropping margins or downsampling images, not by re-rendering pages.
  • When exporting from a word processor, use a preset that keeps text and embeds fonts, rather than printing through an image-based driver.
  • When exporting from design software for print, keep a second copy with live text even if the version you send has its fonts outlined.

Where each tool on this site leaves the text layer

This is worth stating tool by tool, because "PDF tools" covers a range of operations and only some of them can damage the text at all.

ToolEffect on the text layer
Merge, split, rotate, extract pages, organiseUntouched. Pages and objects are moved or removed; the text inside them is never decoded.
Add page numbers, watermarkUntouched. The marks added are real text drawn with an embedded standard font, so they are selectable rather than pasted pictures.
Crop, resize pagesUntouched. Page geometry changes; content is moved or clipped, never re-rendered.
SignUntouched. The signature is added as a separate transparent image object over the page.
Fill formUntouched, unless you flatten — flattening bakes the field appearances into the page, so they can no longer be edited. Whether they stay selectable depends on how the form was authored.
JPG to PDFNot applicable. The page is built from an image, so there was never a text layer to lose.
CompressDestroyed. This tool renders each page and re-encodes it, which is exactly why scans shrink so well and why the text stops being selectable. The tool reports the trade-off in its own output.
PDF to JPGRemoved by definition — the result is an image, not a PDF.
Text to outlinesPermanently removed. That is the operation: live text becomes vector shapes.

If the text layer matters, the safe operations are the ones that only move or clip pages. The risky ones are the ones that rebuild the page from pixels, and the deliberate one is outlining.

Frequently asked questions

How can I tell if a PDF is a scan or real text?
Try to select a line with the cursor. If it highlights and copies, there is a text layer. If nothing highlights, or one rectangle covers the whole page, the page is an image and only OCR can produce text from it.
Why does copied text come out as boxes or question marks?
Because the font subset embedded in the file has no Unicode mapping. The glyphs are drawn correctly but the file cannot say which character each one represents. The usual fix is to re-export from the original application rather than to repair the PDF.
Can I OCR a PDF without uploading it?
Not with the tools on this site — OCR is deliberately not offered, because a credible engine is far too large and too error-prone to run well inside a browser tab. Use desktop software or a scanner that OCRs as it scans.
Does compressing a PDF remove its text?
It can. A compressor that renders each page to an image and rebuilds the document removes the text layer entirely, which is the standard browser-side approach. If searchable text matters, compress a copy and check the result before replacing the original.
Why can I see the text but not select it?
Because you are looking at a picture of text. Scans, photographs and outlined documents all render letterforms without containing characters. The only way to add selectable text to one is to run OCR over it.
Is there any way to recover text that was converted to outlines?
Not textually. The characters no longer exist in the file, only their outlines. The only practical route back is to render the pages and run OCR over them, which reconstructs text by recognising shapes rather than by undoing the conversion.

Do it here, in your browser

Related guides

Every tool on this site processes files on your device. Read the no upload policy to verify that yourself in the Network tab.