What OCR actually does to a scanned document
OCR reads pixels and writes characters into an invisible layer behind the page image — the picture you see never changes.
7 min read · Updated
Optical character recognition is often described as "making a scan editable", which oversells it. What it actually produces is more specific and more useful to understand.
The problem it solves
A scanned page is a photograph. The file contains a grid of pixels that happens to look like text to a human eye. To software there are no letters at all: no search, no copy, no selection, and nothing for a screen reader to announce.
OCR closes that gap by analysing the pixels and producing characters.
How recognition works, in outline
Every engine does roughly the same sequence.
Preprocessing. The image is converted to greyscale, then to a black-and-white version through thresholding — deciding, for each pixel, whether it is ink or paper. Skew is detected and corrected, because rotated text is far harder to segment.
Layout analysis. The page is divided into regions: text blocks, images, ruled lines, tables. Reading order is inferred from those regions. This step is where multi-column and magazine layouts go wrong, before a single character has been recognised.
Segmentation. Text blocks are cut into lines, lines into words, words into individual character shapes.
Classification. Each shape is compared against the engine's trained models and given the most probable character, with a confidence score.
Language modelling. A dictionary and statistical model correct implausible results. This is why choosing the right language matters so much: "rn" and "m" are nearly identical at low resolution, and only a language model resolves which one belongs in a given word.
What a "searchable PDF" is
This is the bit that confuses people most.
When you OCR a PDF, the tool does not replace your scan with typed text. It keeps the original page image exactly as it is and adds a second, invisible text layer positioned behind it, with each recognised word placed at the coordinates where it appears in the picture.
The result: the page looks pixel-for-pixel unchanged, but searching finds words, selecting highlights them in the right place, copying yields text, and screen readers can read it. If a recognition error occurs, the visible page still shows the truth — only the hidden layer is wrong.
That is why a searchable PDF is the standard output for archives. You get machine access without ever discarding the original evidence.
What OCR is not
Not editing. You cannot rewrite a paragraph in a searchable PDF and have it re-flow. The visible content is still a picture.
Not perfect. Accuracy on clean printed text at good resolution is high but never 100%. On poor scans it degrades sharply, and the failures are often silent — plausible-looking wrong words rather than obvious gibberish.
Not structural. Recognition gives you characters and their positions. It does not reliably tell you that a region was a table with four columns, or which of three columns to read first. Complex layouts need extra care.
Not comprehension. An engine that reads "Total: 1,240.00" has recognised eleven characters. It does not know that this is an amount.
Where accuracy actually comes from
Almost all of it is decided before recognition starts: resolution, contrast, straightness, and whether the layout is simple. Choosing a different engine rarely rescues a bad scan; rescanning does. That is the subject of how to improve OCR results.
Running OCR in the browser
Our tools use Tesseract compiled to WebAssembly, so recognition runs on your machine rather than on a server. Two practical consequences.
First, the document is not transmitted anywhere — which matters, because the documents people most need to OCR are medical records, contracts, bank statements and identity papers. The one network request involved downloads the open-source language model for the language you selected; it carries no document content.
Second, you are bounded by your own hardware. A few dozen pages is comfortable. Several hundred is slow, and several thousand belongs in a dedicated pipeline. The background on browser processing covers where that boundary sits.
Choosing between the tools
- OCR PDF — for scanned PDF documents. Produces a searchable PDF with the text layer added.
- OCR Image — for a single photo or screenshot when you want the text itself rather than a document.
- PDF to Text — for PDFs that already have a text layer. Faster and exact; no recognition involved. Check first with these tests so you do not needlessly replace accurate text with recognised guesses.
Common questions
- Does OCR change how my document looks?
- No. The recognised text is placed in an invisible layer positioned behind the original page image. Visually the document is identical; it simply becomes searchable and selectable.
- How long does OCR take?
- In a browser, roughly one to four seconds per page on a laptop and longer on a phone, depending on page complexity. A twenty-page contract is a minute or so; a thousand-page archive is a job for a dedicated pipeline.
- Does OCR understand the document?
- No. It matches shapes to characters and uses a language model to resolve ambiguity between similar glyphs. It has no idea what a total, a date or a signature means.