Tesseract (also called Tesseract OCR) is an open-source optical character recognition engine that converts images of printed or typed text into machine-readable text. In Document AI, it is the most widely deployed free OCR component, often used as the text extraction stage before layout analysis, key information extraction or document question answering.
Tesseract was originally developed at Hewlett-Packard between 1985 and 1994, released as open source in 2005 and later maintained with significant support from Google. Since version 4, its main recognizer is a long short-term memory (LSTM) neural network that reads whole text lines, and it ships trained models for more than 100 languages under the Apache 2.0 license.
How Tesseract recognizes text
Tesseract recognizes text through a pipeline of page analysis followed by line-level recognition. The engine first finds text regions, then splits them into lines and words, and finally passes each line image to the LSTM model, which outputs a character sequence.
The main stages of the pipeline and their outputs are listed in the following table.
| Stage | What happens | Output |
|---|---|---|
| Binarization | Converts the image to black and white using Otsu thresholding | Binary page image |
| Page layout analysis | Detects blocks, columns and text regions | Ordered text blocks |
| Line finding | Groups connected components into baselines | Text line images |
| LSTM recognition | Reads each line as a sequence | Character strings with confidences |
| Output rendering | Writes the requested formats | Plain text, hOCR, ALTO, TSV or searchable PDF |
The LSTM recognizer is trained with connectionist temporal classification (CTC), which lets the model learn character sequences without explicit character segmentation. This approach handles touching and broken characters far better than the legacy engine, which segmented characters and matched them against shape prototypes.
Key settings and model choices
Tesseract output quality depends heavily on a few configuration parameters. Choosing the wrong page segmentation mode is one of the most frequent causes of missing or scrambled text.
| Parameter | Typical values | Effect |
|---|---|---|
| Page segmentation mode (–psm) | 3 automatic, 6 single block, 7 single line, 11 sparse text | How the page is split before recognition |
| OCR engine mode (–oem) | 1 LSTM only, 0 legacy, 2 combined | Which recognizer runs |
| Language (-l) | eng, deu, ces, eng+fra | Model and dictionary used |
| Image resolution | 300 dpi recommended | Character size seen by the model |
| Character whitelist | Digits only, uppercase only | Restricts allowed output characters |
Three families of trained models exist. The tessdata_fast models are smaller and quicker, tessdata_best models are more accurate but slower, and the default tessdata set balances the two. Users can fine-tune a model on their own fonts or scripts with the tesstrain tooling when out-of-the-box accuracy is insufficient.
Preprocessing that determines accuracy
Tesseract performs best on clean, high-contrast, upright images with text roughly 20 to 40 pixels high. Its built-in binarization is simple, so real-world scans and phone photos usually need preprocessing before recognition.
The table below links common image problems to their visible symptoms and the usual fix.
| Problem | Symptom in output | Typical fix |
|---|---|---|
| Skewed scan | Lines merged or split incorrectly | Document deskewing |
| Curved page | Errors increase toward the binding | Document dewarping |
| Low resolution | Confused similar characters such as rn and m | Rescale to about 300 dpi |
| Uneven lighting | Missing text in dark or bright areas | Adaptive document image binarization |
| Noise and stamps | Random symbols in output | Denoising and morphological filtering |
| Tables and borders | Lines read as characters | Remove ruling lines before OCR |
Because many teams skip these steps, Tesseract is sometimes judged inaccurate when the real cause is poor input quality. On clean printed documents, character error rates of roughly 1 to 2 percent are typical, while degraded scans can produce far higher error rates.
Tesseract compared with other OCR options
Tesseract is a general-purpose printed text recognizer, not a full document understanding system. It returns text and positions but does not understand tables, forms or reading order in complex layouts.
| Option | Strength | Main limitation |
|---|---|---|
| Tesseract | Free, offline, many languages | Weak on handwriting and complex layouts |
| PaddleOCR | Strong detection on scene and rotated text | Heavier deep learning stack |
| ABBYY FineReader | High accuracy and layout retention | Commercial license |
| Google Cloud Document AI | Managed OCR with form and table parsers | Cloud processing and usage fees |
| OCR-free models (Donut, Nougat) | End-to-end structured output | Need GPUs and domain tuning |
In modern pipelines, Tesseract often supplies words and bounding boxes to a layout-aware language model such as LayoutLM, or to tools like Docling that combine layout detection with OCR. This division of labor keeps costs low while adding structural understanding.
Limitations to plan for
Tesseract has well-known weaknesses that should guide tool selection before a project starts.
- Handwriting: the standard models are trained on printed text and perform poorly on cursive or handwritten notes.
- Complex layouts: multi-column magazines, forms and nested tables often produce a wrong reading order.
- Scene text: text on signs, packaging or curved surfaces needs a dedicated detector first.
- No semantic extraction: fields such as invoice totals require separate key information extraction.
- CPU throughput: high volumes require parallel processing, since the engine runs single-threaded per page by default.
The simple explanation
Tesseract is free software that reads text from pictures. You give it a scan or a photo of a page. It gives back the words as text you can search, copy and edit.
It works like a careful reader who reads one line at a time. It is very good with clean printed pages. It struggles with messy handwriting or crooked, blurry photos. A cleaner image means better results, much like a person reads a sharp page faster than a smudged one.
How it is used in practice
A municipal archive wants to make 40,000 scanned council records from the 1970s searchable. The team scans pages at 300 dpi, deskews them, removes dark borders and applies adaptive binarization. It then runs Tesseract with the LSTM engine, the English model and page segmentation mode 3, producing searchable PDF files with an invisible text layer and hOCR files with word positions.
Processing runs on an ordinary eight-core server overnight across several batches. A manual sample of 200 pages shows that typed pages reach about 98 percent character accuracy, while pages with handwritten annotations remain partly unreadable and are flagged for review using low word confidence scores. The archive gains full-text search across decades of records without licensing costs, and staff spend their manual effort only on the flagged pages.