Free

Tesseract OCR: recognise scanned text locally

Recognise printed scan text locally with Tesseract OCR and Codex. Check language data, prepare pages and compare the output with the original.

Tools

Installation guide · Download source code (ZIP)

Tesseract recognizes printed text in images locally. Codex can prepare scanned pages, run recognition and save text linked to its original pages for checking.

What you can use it for

  • Get editable text from a scanned document.
  • Recognize English and Russian print on the same page.
  • Save text and word coordinates for subsequent table extraction.

Example: a PDF's text cannot be selected because its pages are photographs. The assistant converts the required pages to images and recognizes them. If usable text already exists, start with extraction, for example through MarkItDown, rather than recognizing it again.

How to install and check languages

  1. Codex checks tesseract --version and tesseract --list-langs.
  2. If installation is needed, it selects a method from the official documentation. On macOS with Homebrew already set up, use brew install tesseract. Linux distribution packages are available; the project's page links to Windows builds. The ZIP above contains source code, not an installer.
  3. English text requires eng; Russian requires rus. The assistant locates the language-data directory and adds the needed project models after approval, then checks the language list again.

How to use it with Codex

No separate MCP is needed when terminal access is available. The assistant locates the scan, identifies its language and runs commands on a copy. Tesseract accepts images; prepare PDF pages with another tool first.

Example for a sample image named page.png:

tesseract page.png result -l rus+eng txt tsv

This creates result.txt with recognized text and result.tsv with information about detected words. Do not add an extension to the output base result: the selected format supplies it. The assistant chooses real paths and languages from your files. See the official command-line guide.

TSV contains words and their positions, not a finished Excel table. Rows, columns, headings and units need separate reconstruction and comparison with the scan.

Where it is used

Extract text and tables from a PDF or scan, choosing recognition: Tesseract handles image-based pages. Later steps in the plan cover reading order, tables and numerical checks.

How to check the result and fix problems

Start with one page. Compare names, dates, amounts, decimal marks and missing text. Rotated pages, small print or poor contrast may require image preparation and another sample.

Language error: check --list-langs and the model location. Mixed-up lines: have the assistant check orientation and page segmentation. Recognition confidence helps locate problem areas, but compare important values with the image. Do not replace unreadable characters with guesses.

The result is text and recognition data linked to the original pages. To finish a table, continue with the PDF and scan extraction plan.

Prompt for recognizing a scan

Paste into Codex or Work with access to the documents:

Find the documents for this task and clarify the required output if unspecified: text, tables or both. Check which PDF pages contain usable text and which contain only images. Preserve originals.
For image-based pages, check Tesseract, languages and the available image-preparation method. Ask approval before installing software or adding models. Select suitable languages, supply paths yourself and recognize one sample page into TXT and TSV. Compare it with the scan before processing the remaining pages.
Keep page order and page references. If tables are needed, reconstruct rows, columns and units separately and prepare CSV or XLSX. Compare names, dates and numbers with the original; mark unreadable parts with a page reference rather than invent values. Open the saved output and check encoding and control values.
In this article
Saved