👁️

OCR PDF

Make a scanned PDF or photo searchable with OCR text recognition, and get its text as a .txt file, in your browser.

Your file is not uploaded. OCR downloads its engine and language data. How to check

How to use OCR PDF

1. Upload a scanned PDF, or a JPG or PNG photo of a document (up to 150 MB).
2. Pick the Document language (English, Spanish, French, German, Italian, Portuguese or Dutch) and click Recognize Text. The first run downloads the OCR engine and up to 3 MB of language data from a public CDN; your file is not sent.
3. Wait while each page is rendered and recognized, then click Download File or Preview Document for the PDF, named searchable_ followed by your file name. The recognized text appears in a box below it: correct any misread words, then click Download Text (.txt) or Copy to Clipboard.

Key features of OCR PDF

🔒 Recognition runs on your device

Each page is drawn to a canvas with pdf.js and read by a tesseract.js worker (Tesseract compiled to WebAssembly). The engine and language data are downloaded once from a CDN; the document itself never leaves your browser.

🔍 Invisible text layer

Every recognized word is written over its position with pdf-lib in text render mode 3, so the page looks the same but you can search, select and copy the text in any PDF viewer.

🖼️ Photos work too

A JPG or PNG is wrapped in a one-page PDF first and then recognized the same way, so a photo also comes back as a searchable PDF.

📝 The text on its own

The recognized words also fill an editable box under the result, one line per recognized line, with a blank line between paragraphs and a --- Page N --- line before each page of a longer file. Download Text (.txt) saves the box as it is, corrections included.

About OCR PDF

OCR PDF rasterises each page at up to twice its size (about 144 DPI for A4 or Letter) with pdf.js, hands the bitmap to a tesseract.js Web Worker, and draws each recognized word back over its position in Helvetica as invisible text. Words the engine scores below 40 out of 100 in confidence are dropped rather than guessed. The page image itself is left exactly as it was.

It is useful for a scanned contract you need to search, a photographed receipt you want to copy figures from, or an old report that arrived as page images. Two limits: the text layer uses Helvetica, so words with characters outside its WinAnsi range (non-Latin scripts, for instance) are skipped; and a blurry, skewed or low-contrast scan will be recognized only in part.

When to use OCR PDF

A folder of scanned letters or supplier invoices you want to archive: run each file through OCR before filing it, and desktop search tools that index PDF text can later find it by a name, a date or an invoice number.

A scan whose words you need in another program: recognize the text here, correct it in the box under the result, and click Download Text (.txt) or Copy to Clipboard. For a Word file instead, give the searchable_ file to PDF to Word, which reads the invisible words written here like any other text.

A photo rather than a scan: a notice on a wall, a page of a book, a printed menu. The JPG or PNG becomes a one-page PDF with the words underneath the picture, and you can copy a phone number out of it in any PDF viewer.

Do not use it on a PDF that already has selectable text, such as one exported from a word processor: the tool cannot tell, and adds a second layer over the first. For pages you still have to capture, use Scan to PDF and recognize the result, and if the scan is heavy, Compress PDF leaves the text layer alone whichever order you run them in.

Tips and troubleshooting

  • "OCR failed" followed by a reason stops the run, and Try Again reloads the page. When no word is recognized at all, the card says "No readable text was found" and offers no file. An encrypted PDF, even one that only restricts printing, is refused by pdf-lib; remove the protection with Unlock PDF first. "The OCR engine (tesseract.js) did not load" means the library could not be fetched from the CDN.
  • Only PDF, JPG and PNG are accepted. A WEBP, HEIC or TIFF file dropped on the zone stops with "This file is not a PDF, JPG or PNG", because the tool can wrap only JPEG and PNG pictures. Put a WEBP photo through Scan to PDF first, which re-encodes it to JPEG, then recognize that PDF. Scan to PDF opens HEIC and TIFF only in a browser that can display them, such as Safari; elsewhere save the photo as JPG first.
  • The progress messages name each stage: Loading tesseract core and Loading language traineddata are the one-time downloads, then Recognizing text counts the pages done. A page full of text can take half a minute or more, so up to four pages are read at the same time, each by its own worker, as far as the processor cores and memory the browser reports allow. Rendering uses the print intent of pdf.js, so the run keeps going if you switch to another tab.
  • The output is searchable_ plus your file name with a .pdf extension, so receipt.jpg becomes searchable_receipt.pdf, and Download Text (.txt) saves receipt.txt. For a photo the page is as many points wide as the image is pixels, so a 4000 px wide photo gives a page about 55 inches wide; viewers fit it to the window, but scale it before printing.
  • One language per run. A document that mixes two languages gets a layer for the one you chose, and low-confidence words in the other are dropped.
  • A page stored with a rotation flag is rendered the way it displays, and the words are mapped back onto it and turned by the same angle, so the layer lines up. A scan that is physically sideways has no flag; turn it with Rotate PDF before running OCR.
  • The guide how to make a scanned PDF searchable explains what affects accuracy and what to do with photos.

How OCR PDF works in your browser

The file is read into memory and opened with pdf-lib; an image is first embedded on a new page of its own size. pdf.js receives a copy of the bytes, since it transfers its buffer to a worker, and Tesseract.createWorker starts the engine for the language you picked: the worker script comes from cdnjs, the WebAssembly core and the traineddata file from the library's default CDNs. Once it is ready, up to three more workers start from the language data it cached, and each worker takes the next unread page. pdf.js draws the page into a canvas at twice its size, stopping at 2,400 pixels on the long side; a page already larger than that, such as a photo placed on a page of its own pixel size, is drawn at its own size, up to 16 megapixels; a larger page is scaled down to 16 megapixels to stay within the canvas limit of mobile browsers. The worker returns words with bounding boxes and confidence scores, and each box is converted to PDF points. The font size is 85% of the box height, reduced if Helvetica would spill past the box, and the words are drawn between setting the text render mode to invisible and setting it back to fill.

Each canvas is cleared after its page, and the workers are terminated after the last one. The document exists in the tab in two copies, one for pdf-lib and one inside the pdf.js worker; neither is sent anywhere, and the only downloads are the engine and the language data. Saving with pdf-lib produces the bytes that Download File offers, and Preview Document renders them with pdf.js in a modal.

The same words are also joined into plain text, one line per recognized line, with a blank line where the space to the next line is well above the page's usual line spacing. That text fills the box under the result. Download Text (.txt) saves whatever the box holds as a UTF-8 file named after yours, so corrections made there never change the PDF.

Frequently asked questions

Is my document uploaded anywhere?

No. Recognition runs in a Web Worker in your browser. Apart from Google Analytics while it is switched on, the only network traffic is the download of the tesseract.js engine and the language data for the language you pick, the first time you run it.

Which languages are supported?

English, Spanish, French, German, Italian, Portuguese and Dutch. Pick the document's language before you run it; each language has its own data file of 0.7 to 3 MB.

How accurate is the result?

It depends on the scan. Straight, high-contrast pages give the most complete text layer; blurry photos, handwriting and skewed pages are recognized only in part. Words the engine is not confident about are left out rather than guessed, and the result message says how many words were found on how many pages.

Can I run OCR on a PDF that already has text?

You can, but you should not need to. The tool does not detect existing text, so it draws a second invisible copy of every word it recognizes over the first, and a search may then find each word twice. Check the file with PDF to Text first; if it returns text, skip OCR.

Will the file get bigger?

A little, usually. The page images are not re-encoded; what is added is one invisible text string per recognized word and a reference to the built-in Helvetica font, which is not embedded. pdf-lib rewrites the file when it saves, so the exact difference varies from file to file.

Can I OCR several files at once?

No, one file per run. To handle a batch in one go, join the PDFs with Merge PDF first, or turn a set of photos into one PDF with Scan to PDF, and then recognize that single file. The progress message counts the pages done.

Last reviewed