Chris Collins

Tools · graphics

OCR: text from images and PDFs

Read text from photos, screenshots, scans and PDFs with Tesseract compiled to WebAssembly — clean up the image (threshold, deskew, upscale), pick a region, see every word's confidence, and export text, hOCR, TSV or JSON.

Added

How to use it

The Tesseract OCR engine (its LSTM neural-network recogniser), compiled to WebAssembly by Tesseract.js, runs in a worker on this page. Your images are never uploaded. What is downloaded, once, from the jsDelivr CDN: the engine (about 5 MB), each language’s trained data (2–15 MB), and — only when you open a PDF — Mozilla’s pdf.js to render pages.

Steps

  1. Get an image in: drop, paste a screenshot (Cmd/Ctrl+V), choose a file, or use Camera to photograph a document. A sample page (tilted, with paper noise) loads on your first visit. For a PDF, choose pages (1-3,5, 8-) and a resolution — 300 dpi reads small print best.

  2. Clean up if needed:

    • Orientation turns sideways or upside-down pages.

    • Auto-deskew measures the tilt of the text lines and straightens the page. It tries angles from −15° to +15° and keeps the one whose horizontal projection of dark pixels is "peakiest" (the largest sum of squared row counts) — lines of text line up into sharp peaks only when they are level. Fine-tune with the slider.

    • Threshold turns the page pure black and white. Auto uses Otsu’s method, which picks the grey level that best separates two classes of pixels; Manual lets you rescue faint or unevenly lit scans. Stretch contrast maps the darkest and lightest 1% to black and white.

    • Upscale 2× helps when text is under about 20 pixels tall (Tesseract works best around 30 px capital height).

    • Invert is for light text on a dark background.

  3. Pick a region by dragging on the image to read just part of it (a table cell, a label).

  4. Read: choose the language(s) — several can be combined, such as English + German — and the layout mode. Single line or Single word help with labels; Sparse text finds scattered text such as signs and diagrams. Only these characters limits recognition (digits for meter readings, for example).

Results

Each recognised word gets a box on the image, coloured by Tesseract’s confidence: green ≥ 85%, amber 60–85%, red below 60%. Hover a box to see the word and its score. The text is editable. Multi-page PDFs can be read page by page or all at once.

Exports:

  • TXT — plain text (page separators when exporting all pages).

  • hOCR — the standard HTML-based OCR format with word boxes and confidences, accepted by tools such as hocr-tools and OCRmyPDF’s hocrtransform to build searchable PDFs.

  • TSV — Tesseract’s tab-separated word table (level, page, block, paragraph, line, word, left, top, width, height, confidence, text).

  • JSON — every word with its box, confidence and position in the layout.

Box coordinates refer to the cleaned-up image (after rotation and upscaling).

Limits

  • Handwriting, decorative fonts, very low-resolution photos and text on busy backgrounds read poorly; confidence scores will say so.

  • Born-digital PDFs usually contain real text already — copy it from a PDF viewer instead.

  • Large multi-page jobs take time: roughly 1–5 seconds per page on a laptop.

Runs entirely in your browser — network requests go only to the services named on this page.