OCR a Scanned PDF to Text on Your Own Device
OCR (optical character recognition) turns pictures of text, such as scanned PDF pages, into actual machine-readable text. This tool renders each page of your PDF, or takes a single image, and runs the Tesseract recognition engine on it as WebAssembly in your browser, producing a downloadable .txt file with page breaks — no file ever leaves your device.
A scanned PDF contains photographs of pages, not text — which is why our regular PDF to Text tool comes back empty on scans. This page closes that gap with genuine on-device OCR. Expectations, honestly stated up front: recognition quality depends heavily on scan quality; only the English model is loaded, so other languages will not recognize properly; the output is a plain .txt file, not a searchable PDF; processing covers up to 50 pages per run at your choice of 144 or 216 DPI; and the engine plus model is an ~11 MB one-time download the first time you use it. Because everything runs locally, it is a reasonable choice for documents you would never send to a cloud OCR service.
How it works
Recognition happens in three stages. First, pdf.js renders each PDF page to a bitmap at the resolution you chose — 144 or 216 DPI. Resolution matters because Tesseract's models were trained on text where a lowercase letter spans roughly 20–30 pixels; body text at 144 DPI lands in that range, while dense footnotes may need 216. If you supply a single image instead of a PDF, this stage is skipped and the image is recognized as-is.
Second, each bitmap goes to Tesseract — the open-source OCR engine originally developed at HP and later maintained by Google — compiled to WebAssembly so it runs inside the browser at near-native speed. Its LSTM neural network first binarizes the image and segments it into text lines, then reads each line as a sequence, scoring character hypotheses against its English language model. That language model is why "cl" is rarely misread as "d" in real words but unusual strings like serial numbers see more errors, and it is also why running the English model on German or French text produces plausible-looking nonsense. The engine and its trained data (~11 MB together) are fetched once and cached; on first use expect a short delay before recognition starts.
Third, the per-page results are concatenated into one .txt file, with a page-break marker between pages so the text stays traceable to its source page. Tesseract runs in background workers to keep the page responsive — which is the source of one practical limit: when the site is opened directly from disk via a file:// address, browsers commonly block those workers, so serve the folder over http (any localhost server works) if recognition refuses to start.
Worked example: a 12-page scanned lease
A lease scanned at 300 DPI into a 12-page, 9.4 MB PDF with no text layer — selecting text in a viewer grabs nothing. Run through this tool at 144 DPI on a mid-range laptop: the first page waits about 8 seconds for the one-time 11 MB engine download, then recognition proceeds at roughly 4–6 seconds per page, finishing the document in around 70 seconds. The output is a 31 KB .txt file containing about 5,200 words across 12 page-break-separated sections. Spot-checking one dense clause finds 3 character errors in 480 characters (99.4% accuracy) — but the same document re-scanned at 150 DPI with heavy JPEG compression drops to roughly 96%, dozens of errors, which is the difference scan quality makes.
Frequently asked questions
Can I OCR a scanned PDF without uploading it anywhere?
Yes. The Tesseract engine runs as WebAssembly inside your browser, so pages are rendered and recognized on your own device. The one download is the engine and its English model, about 11 MB, fetched on first use.
How accurate is the text recognition on scans?
On a clean 300 DPI scan of printed text, Tesseract typically gets well above 95 percent of characters right. Accuracy drops with skewed pages, low-resolution or compressed scans, handwriting, and unusual fonts, so always proofread the output.
Does this tool support languages other than English?
Not yet: only the English recognition model is loaded, so non-English documents will come out garbled. Accented characters that appear in English text are usually still recognized, but for other languages use desktop Tesseract with the matching language pack.
Can it produce a searchable PDF instead of a text file?
No, the output is currently a .txt file with a page-break marker between pages. Embedding an invisible text layer under the scan to make a searchable PDF is not offered yet; desktop tools like OCRmyPDF do that.
Why does OCR fail when I open this page from a local file?
Browsers often block the background workers Tesseract needs when a page is opened from a file:// address. Serve the site over http, for example from a small localhost server, and recognition will run normally.
What do the 144 and 216 DPI settings change?
They set the resolution at which each PDF page is rendered before recognition. 216 DPI usually recognizes small print better but takes roughly twice as long per page as 144 DPI, which is enough for ordinary body text.