Tesseract PSM Modes Explained: Fix Gibberish OCR Output

⚡ Quick Answer

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)

PSMAssumes…Use it for
3Full page, auto layout (default)Normal documents, scans
6Single uniform text blockCropped paragraphs, articles
7Single text lineReceipt lines, captions, labels
8Single wordLogos, cropped words
10Single characterCAPTCHAs, isolated glyphs
11Sparse text, any orderScreenshots, scattered UI text
13Raw line, no layout analysisLast 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

tesseract receipt.png out –psm 7 -l eng tesseract screenshot.png out –psm 11 -l eng tesseract block.png out –psm 6 -l eng+deu

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

  1. Garbage on a cropped region? Try PSM 6 (block), 7 (line), or 11 (sparse) — in that order.
  2. 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.
  3. Single line still failing? PSM 13 skips layout analysis entirely — the last resort.
  4. Still garbage? Now it’s an image-quality problem, not PSM — work through preprocessing.
Rule of thumb: match the PSM to the shape of your text. Full page → 3. Cropped block → 6. One line → 7. One word → 8. Scattered fragments → 11. Getting this right fixes more “bad OCR” than any preprocessing filter.

Frequently Asked Questions

What is Tesseract PSM?
PSM (Page Segmentation Mode, –psm 0-13) tells Tesseract what shape the text is before recognition starts: full page (3, the default), uniform block (6), single line (7), single word (8), sparse text (11), and others. Choosing the wrong mode is the most common cause of garbage output on cropped images.
Which PSM mode is best for receipts?
PSM 7 (single text line) for individual receipt lines, or PSM 6 (uniform block) for a cropped receipt. The default PSM 3 assumes a full document page and misfires on narrow receipt shapes.
Why does Tesseract read words in the wrong order?
Usually PSM 11 (sparse text) finding text “in no particular order”, or the default PSM 3 misjudging columns. Crop tighter to the text and use PSM 6, or draw manual recognition zones in a GUI like gImageReader.

Skip the command line

gImageReader gives you Tesseract’s power with a visual interface — free.

Download gImageReader Free

Similar Posts