OCR in the browser: extract text from an image privately

Optical character recognition turns pixels into text. Doing it locally matters more than it sounds, because the images people most want to read — receipts, invoices, letters, prescriptions — are exactly the ones you should not upload to a free service.

How browser OCR works

The page loads a recognition model into the tab, slices the image into text lines, and predicts characters for each region. The output is a string, plus usually the position of each block so you can tell which text came from where.

The model is small — a few megabytes — which is what makes it practical to download and cache. The trade is that it is less accurate than a large server-side engine on difficult material, and it does not have a language model to correct itself afterwards.

Getting a good result

  1. Use the sharpest version of the image you have. OCR fails on blur long before a human does.
  2. Straighten the page first if it is photographed at an angle — Scan & Deskew is built for this.
  3. Increase contrast on faded print with Levels; text needs a clear separation from the paper.
  4. Crop to the text with Crop and drop the desk around it. Extra background is extra work for the model.
  5. Run OCR Text and read the output against the page before trusting it.

Where it is reliable, and where it is not

Reliable: printed text, screenshots, slides, receipts with clear fonts, and documents photographed flat with even light.

Unreliable: handwriting, stylised logos, text on a curved surface, thermal paper that has faded, and any image where the letter shapes are broken by compression. Emoji and symbols are frequently dropped or replaced.

Numbers deserve special caution. A digit misread as another digit — 3 for 8, 1 for 7 — produces text that looks correct and is wrong. If the output feeds an invoice amount, an account number or a dosage, verify every digit against the page by eye.

Checking the result in a minute

Copy the text out and read the first and last line against the image: OCR usually fails at the edges of a page first. Then search the output for the numbers — dates, totals, reference codes — because a wrong digit is the error that actually costs something. If the output is broadly right but a few words are mangled, correct them by hand; a second pass on the same blurry image will usually reproduce the same mistakes.

What to do with the text

OCR for PDFs

A PDF can be either a text document or a container of page images. If its text can be selected, it already contains characters and does not need OCR. If selecting text does nothing, the pages are images — render them first with PDF to Images, then read each page.

Why local OCR is the private option

A free OCR service has to receive the document to read it. That means an invoice with bank details, a letter with a diagnosis, or a passport scan sitting on someone else's disk, subject to a retention policy you cannot inspect.

Local OCR removes that step: the model reads the pixels in the tab and the text is written into the page. Open the network panel and confirm — the only transfer is the model itself, once. That is a verifiable claim rather than a promise, which is rare enough in this category to be worth saying twice.