Pixels that look like letters, and the layer that finds them
A scanned page is a photograph of writing. To you it reads as a contract or an invoice; to every program that opens it, it is a rectangle of coloured dots with no text in it whatsoever. That is why a keyword search finds nothing, why you cannot drag a cursor across a clause to copy it, and why pasting a scanned page into anything text shaped gives you an image.
Optical character recognition reverses that. The pixels are analysed, characters are reconstructed, and the recovered words are written back into the PDF as a text layer marked invisible, positioned so each word sits over the printed word it came from. Your eyes see the scan exactly as before. A search box sees real text.
Three pieces do the work here, all inside the page you are reading. PDF.js, the renderer behind Firefox’s built in PDF viewer, draws each page onto a canvas. Tesseract, the open source recogniser that began at HP and later spent years under Google’s stewardship, compiled to WebAssembly, reads that canvas. pdf-lib then writes the words back into the original document. Your file is never sent anywhere; the recogniser’s own code, its WebAssembly core and the trained model for the language you pick are what get downloaded, once, from public package CDNs when you first run a job.
From scan to searchable copy, step by step
- Drop your scanned PDF onto the box, or press “Choose a file”. One document per run, and only a .pdf is accepted.
- Set “Text language” to the language actually printed on the page. English is preselected.
- Set “OCR resolution” to “Faster (100 DPI, lower accuracy)”, “Recommended (150 DPI)” or “Most accurate (300 DPI, slowest)”.
- Press the button, which reads “OCR PDF: Make a Scanned PDF Searchable”, the same wording as the page title, and leave the tab open while the bar fills.
- Download the result. A file called report.pdf comes back as report-searchable.pdf, looking the same and answering to a text search.
The progress bar is driven by the recogniser’s own reporting and is spread across the page count, so on a twenty page document the first page finishing moves it to roughly five percent. It is not guessing.
One CPU core, and the speed to plan for
This is one of the heaviest jobs on the site, and the reason is structural rather than fixable. Browsers only unlock multi threaded WebAssembly for pages that send the COOP and COEP response headers, and those headers break the display ads that keep everything here free. In this case the point is moot anyway: the Tesseract core package ships only single threaded WebAssembly builds, so there is no threaded variant to select even if the headers were available. Recognition runs on one core.
For a sense of scale, the measurement taken while this tool was built put recognition at roughly 300 milliseconds for a 58 word, roughly one megapixel test image, after a one time worker startup of about 400 milliseconds. A dense full page carries far more than 58 words, and every page in your document pays both a rasterisation pass and a recognition pass, so a long scan can run for minutes. Try a two or three page document first and extrapolate from what your own machine does.
There is no per page error handling either. If one page fails to render, the whole run stops and the shell shows its one generic failure message, with the real reason logged to the browser console. Nothing partial is recoverable.
Where each recognised word lands on the page
The coordinate work is the interesting part. The recogniser reports a box for every word in the pixel space of the rasterised canvas, measured from the top left. A PDF page measures from the bottom left, in points. Dividing the pixel measurements by the render scale converts them back to points, and subtracting from the page height flips the axis, which puts the word where it belongs on the untouched original page.
Two honest limits fall out of this. The invisible run’s size is taken from the height of the word’s box, which is a stand in for real font metrics rather than a reconstruction of them. And the invisible text is set in Helvetica, so on the rare occasion the recogniser produces a character that font cannot encode, that single word is skipped rather than the whole page’s layer being abandoned. A page where nothing at all is recognised gets no layer added and passes through untouched.
Extracting text against baking it in
The neighbouring tool, Extract Text from Image (OCR), runs the same recogniser but answers a different question. It takes images, several at once, and hands back a plain .txt file of what it read. It will not take a PDF at all, since its accepted list is image extensions only. Use it when you want the words and nothing else.
This tool is for when you want to keep the document. You get a PDF back, page for page identical to look at, that now answers to a search box, lets you select a paragraph and lets you copy a clause. Downstream, that changes what other tools can do with it.
Two useful pairings. If your source is paper rather than an existing file, capture it with Document Scanner with Webcam first, which flattens the perspective and exports a multi page PDF this tool accepts directly. And if you only ever need the pages as pictures, for instance to attach a single sheet to an email, Convert PDF to JPG is the shorter route, though a multi page document comes back from it as a ZIP. The rest of the document tooling sits on the PDF tools hub.
The documents people actually run through this
The scans worth making searchable tend to be the ones you would least like to hand to a stranger’s server: a signed lease, a scanned passport page, a medical form, years of bank statements. Doing the recognition locally is what makes those safe to process at all, and it is also why the honest speed warning above matters. Nothing about the trade is hidden. You spend your own CPU time instead of someone else’s, and in exchange the document stays where it is.
Beyond that, the everyday uses are unglamorous and useful: finding one clause in a photocopied contract without rereading it, pulling amounts out of scanned receipts for bookkeeping, or turning a shelf of digitised paper records into an archive you can search through rather than open one file at a time.