Tesseract PSM Modes Explained: Fix Gibberish OCR Output
Tesseract’s PSM (Page Segmentation Mode) tells the engine what shape your text is.
The default (PSM 3) assumes a full page — which is why single lines, receipts, and sparse text come out
as garbage. Fix: PSM 6 for uniform text blocks, PSM 7 for single lines,
PSM 8 for single words, PSM 11 for scattered text. Set via
--psm N.
“Tesseract works on one image and produces garbage on another” — nine times out of ten, the fix isn’t preprocessing, it’s the page segmentation mode. This guide explains all 14 PSM modes, which to use when, and how to stop guessing.
What PSM Actually Does
Before recognizing a single character, Tesseract must decide where the text is — columns, lines, words. PSM is that decision, expressed as a number from 0 to 13. The default, PSM 3 (“fully automatic page segmentation”), assumes a normal document page. Feed it anything else — a receipt line, a cropped word, a screenshot fragment — and the layout analysis misfires before recognition even starts.
The PSM Modes That Matter (Cheat Sheet)
| PSM | Assumes… | Use it for |
|---|---|---|
| 3 | Full page, auto layout (default) | Normal documents, scans |
| 6 | Single uniform text block | Cropped paragraphs, articles |
| 7 | Single text line | Receipt lines, captions, labels |
| 8 | Single word | Logos, cropped words |
| 10 | Single character | CAPTCHAs, isolated glyphs |
| 11 | Sparse text, any order | Screenshots, scattered UI text |
| 13 | Raw line, no layout analysis | Last resort for stubborn lines |
Modes 0–2, 4–5, 9, 12 are OSD/detection variants and orientation helpers — rarely needed for plain OCR.
How to Set It
In gImageReader, the equivalent lives in the recognition settings — the app handles common cases automatically, but knowing PSM explains why a tight crop sometimes beats a full page (see our accuracy guide).
The 60-Second Diagnostic
- Garbage on a cropped region? Try PSM 6 (block), 7 (line), or 11 (sparse) — in that order.
- Words in wrong order? PSM 11 finds text “in no particular order” — great for detection, bad for reading order. Prefer PSM 6 with a tighter crop.
- Single line still failing? PSM 13 skips layout analysis entirely — the last resort.
- Still garbage? Now it’s an image-quality problem, not PSM — work through preprocessing.
Frequently Asked Questions
Skip the command line
gImageReader gives you Tesseract’s power with a visual interface — free.
Download gImageReader Free