How the OCR works, step by step
When you press the OCR button, three things happen for every page:
- Render. The page is drawn as a high-resolution image (200 or 300 DPI) using PDF.js — the same rendering a PDF reader does.
- Recognize. Tesseract.js, a WebAssembly build of the Tesseract OCR engine, analyzes the image: it finds text lines, splits them into words and characters, and classifies each character. It reports every word with a bounding box — the rectangle where that word sits.
- Rebuild. pdf-lib writes a new PDF: the page image at full size, then each recognized word drawn invisibly (fully transparent) at its bounding-box position and size. Readers display the image; search and selection use the hidden words.
Because the text layer is invisible, the document looks exactly like your scan — including its imperfections. The words underneath are the OCR engine's best reading of it, which is why proofreading matters (see the accuracy section).
Languages you can OCR
Pick the language the document is written in — the engine uses that language's character models and dictionary, and the wrong choice noticeably hurts accuracy. Mixed-language documents work best when you pick the majority language.
| Language | Script | Notes |
|---|---|---|
| English | Latin | Fastest and most accurate on typical scans |
| Spanish, French, German, Italian, Portuguese | Latin | Accents and diacritics are recognized |
| Russian | Cyrillic | Full Cyrillic alphabet support |
| Hindi | Devanagari | Conjunct characters can be harder for OCR |
| Arabic | Arabic | Right-to-left text; download the .txt to check reading order |
| Chinese (Simplified) | Han | Large language data — first run downloads more |
| Japanese | Han + Kana | Vertical text is not well supported |
One honest limitation: the invisible text layer in the rebuilt PDF is typeset in a standard Latin font, so words in non-Latin scripts are placed reliably in the .txt download, while the PDF's hidden layer is most dependable for Latin-script languages.
What decides OCR accuracy
OCR is not magic — it is pattern matching, and its quality is decided long before this tool sees the file. In rough order of impact:
- Resolution. Text rendered under ~200 DPI gives the engine too few pixels per character. Choose 300 DPI here, and scan at 300 DPI or better at the source.
- Straightness. Skewed pages (even 2–3 degrees) break line detection. Re-scan crooked pages flat and square.
- Contrast. Faded ink, grey backgrounds, shadows across the page and show-through from the other side all cost accuracy.
- Font. Clean printed fonts read best. Decorative fonts, dot-matrix print and handwriting read poorly or not at all.
- Cleanliness. Stamps over text, coffee stains, underlining and hole-punch shadows are all read as "characters".
On a clean 300 DPI scan of printed text, expect the high nineties per cent of words to be right. On a photographed page in poor light, expect noticeably less — and always proofread anything that matters, especially numbers, names and dates, which OCR can change silently (0/O, 1/l, 5/S are classic confusions).
Honest limits of this OCR tool
- Accuracy is never 100%. The text layer is the engine's best reading, not a guarantee. Check important documents against the scan.
- Handwriting is largely out of reach. Tesseract is built for print. Neat block capitals may partly read; cursive will not.
- It is slow on long documents. OCR runs on your device, page by page — a 100-page scan can take many minutes. There is no queue jump because there is no server.
- Layout is not reconstructed. The output keeps the page image, so it looks right — but the hidden text is words in reading order, not rebuilt paragraphs, tables or columns. For editable documents, use the .txt output or PDF to Word on an already-digital PDF.
- Non-Latin scripts: as noted above, the .txt download carries those words reliably; the PDF's hidden layer is best for Latin scripts.
- Password-protected PDFs cannot be opened — and this tool does not guess or bypass passwords.
Tips for a better OCR result
- Scan at 300 DPI, in greyscale or colour — not black-and-white mode, which throws away detail the engine uses.
- Flatten and straighten the page; photograph documents from directly above in even light if you have no scanner.
- Pick the right language before running — it changes the dictionary the engine checks words against.
- Try the other DPI if a page reads badly: sometimes 200 DPI's slight smoothing beats 300 DPI's noise.
- Proofread numbers twice. Totals, account numbers and dates are where a single misread character does real damage.
- Split very long scans with Split PDF and OCR them in parts, so a browser hiccup never costs you the whole job.
What people OCR most
- Paper archives — making years of scanned letters and statements findable with Ctrl+F.
- Contracts and agreements — so clauses can be copied into emails and compared.
- Receipts and invoices — pulling figures into a spreadsheet via the text download.
- Book and article scans — quoting passages without retyping them.
- Forms and certificates — extracting names, dates and reference numbers accurately.
- Accessibility — a text layer is what screen readers read aloud; an image-only PDF is silent to them.
Privacy: your scans stay on your device
Scanned documents are among the most private files people own — identity papers, medical letters, signed contracts. This tool was built so that privacy does not depend on trusting us: the file is never uploaded. PDF.js renders it locally, Tesseract.js (WebAssembly) reads it locally, and pdf-lib rebuilds it locally. The only downloads are the OCR engine and language data coming to your browser.
You can verify this yourself: load the page, disconnect from the internet, and OCR a document (after the first run has fetched the language data). It still works — because there is no server in the loop.
Troubleshooting
- "OCR found no readable words" — the pages may be blank, extremely faint, or in a different language than selected. Check the language and try 300 DPI.
- The first run seems stuck — it is downloading the OCR engine and language data (a few MB; more for Chinese). Later runs start immediately.
- Words are in the wrong order — multi-column pages are read in the engine's best guess of reading order; the .txt shows the same order the PDF layer uses.
- The browser tab gets slow or crashes on a huge scan — OCR is memory-hungry at 300 DPI. Split the PDF and process fewer pages at a time.
- The PDF is password-protected — remove the password first if the file is yours (PDF Password Remover), then OCR the unlocked copy.