PdfEditorOnlineFree

4 min readGuides

Turn a scanned PDF into searchable text without uploading it

Why a scanned PDF has no text to find, how optical character recognition adds a text layer, and how to get accurate results from imperfect scans in the browser.

A scanned PDF contains page images, not text, which is why search finds nothing inside it. Optical character recognition reads those images, recognises the characters, and writes an invisible text layer behind the picture so the page looks identical but becomes searchable and selectable. Modern browsers can run the whole recognition step locally, so the scan never has to be uploaded.

  • Scanned pages are images, so search and copy fail until an OCR text layer is added underneath them.
  • Input quality decides accuracy far more than the engine does; straighten, crop, and raise contrast before recognising.
  • Always spot-check numbers, names, and tables, because OCR errors are confident and silent rather than obvious.

You search a 40-page scanned contract for the word "termination" and your reader reports zero results, even though you can see the word on page 11. Nothing is broken. The page is a photograph, and there is no text in it to find.

Why a scanned page has no text

A born-digital PDF stores text as character codes plus font references. The reader knows that a particular glyph is the letter t because the file says so, which is what makes search, copy, and reflow possible.

A scan stores something completely different: a grid of pixels. The shapes look like letters to you because your visual system is excellent at this. To the reader software it is one large image with no more linguistic content than a photo of a beach.

Optical character recognition closes that gap. It segments the image into lines, then words, then character shapes, classifies each shape, and writes the resulting characters into the PDF as an invisible text layer positioned exactly behind the visible pixels. The page looks byte-for-byte the same on screen, but now it is searchable, selectable, and indexable.

The browser-local OCR tool performs that recognition inside the tab using a WebAssembly engine, so a scanned medical record or bank statement does not need to be handed to a recognition service to become searchable.

Fix the scan before you recognise it

Recognition accuracy is dominated by input quality. A better engine improves a bad scan by a few percent; a better scan improves it by an order of magnitude. Before running OCR, deal with these in order:

  1. Resolution. Aim for roughly 300 pixels per inch of original page. Below about 200, small type starts to collapse into ambiguity, and no amount of upscaling afterwards restores information the sensor never captured.
  2. Skew. Even two or three degrees of rotation smears the horizontal line detection that everything else depends on. Deskewing is the single highest value correction you can make.
  3. Contrast and shadow. Phone photos often carry a gradient across the page from the light behind you. Flattening that gradient turns grey mush into crisp black on white.
  4. Crop. Cut the desk, the fingers, and the neighbouring page out of the frame. Extra content invites the engine to hallucinate a column that is not there.
  5. Language. Tell the engine which language and alphabet to expect. A recogniser guessing between Latin and Cyrillic wastes accuracy it could spend on your actual text.

If the source is a phone photo rather than a flatbed scan, run it through the document scanning tool first. Edge detection, perspective correction, and contrast normalisation are exactly the preprocessing steps that OCR wants, and doing them first usually matters more than any setting you change afterwards.

Check the output, because errors are silent

OCR does not fail loudly. It produces a confident, plausible, wrong character and moves on. The classic confusions are worth memorising because they cluster in exactly the places that matter:

Frequently confused Where it hurts
0 and O, 1 and l and I account numbers, invoice references, part codes
5 and S, 8 and B, 6 and G totals, quantities, serial numbers
rn read as m names and addresses
Decimal points lost in noise every financial figure on the page

So verify before you rely on it. Run the text extraction tool on the recognised file and read the plain text output. Errors that are invisible under the original image — because your eye reads the picture, not the text layer — become obvious in raw text. Search for a handful of terms you know appear in the document; if they do not come back, the layer landed badly and it is worth rescanning the affected pages.

For anything numeric — invoices, statements, lab results, meter readings — check the digits by hand. A misread total in a searchable archive is worse than no searchable archive at all, because it looks authoritative.

What OCR does not do

It is worth being clear about the limits:

  • It does not reconstruct the original layout as editable structure. You get positioned text, not a clean word processor document with real headings.
  • It does not reliably recover complex tables. Ruled lines help; borderless columns with ragged spacing usually do not survive intact.
  • It does not read most cursive handwriting well. Neat printed hand-writing is a different and more tractable problem than joined-up script.
  • It does not shrink the file. The page image stays exactly as it was and a small text layer is added, so the result is marginally larger, not smaller.

Keep the searchable copy from becoming unnecessarily large

OCR adds text; it does not replace the page image. If the source scan contains oversized photographs, broad desk borders, shadows, or maximum-resolution captures, the searchable output carries that weight forward.

Use this order:

  1. Preserve the original scan.
  2. Correct poor framing, perspective, and lighting before recognition when a cleaner recapture is available.
  3. Run OCR and verify consequential words and numbers against the page image.
  4. Analyse the recognized PDF with the PDF compression tool.
  5. Reopen the smaller copy and check fine print, stamps, signatures, and the terms you expect search to find.

Compressing first can make weak characters harder to recognize. Recognizing first keeps the text layer available while eligible oversized images are reduced afterwards. The oversized scanned-PDF guide explains when rescanning is safer than aggressive compression.

OCR is additive: the picture remains the visual source and the text layer is a search aid. Keep the original whenever the scan is evidence or the smallest details may matter later.

Tools used in this guide

Each workspace runs in this browser tab. Open one directly to apply the steps above to your own document.

Written by The PdfEditorOnlineFree team. Published and last reviewed . Product behaviour described here reflects the linked workspaces at the time of review; check the tool page for current limits.