Tesseract at 150 vs 300 dpi: 1.2 s a Page, 0.3 Points Apart
Every OCR guide says 300 dpi. Nobody shows what 150 dpi costs you in accuracy, or how long 1,000 pages actually takes.
📜 Table of Contents
📖 Keep reading
Render a scanned page at 150 dpi and Tesseract 5.3 reads it in about 1.2 seconds on a 2 vCPU VM, with 99.4 percent of words matching the reference text. Render the same page at 300 dpi and you wait 2.4 seconds for 99.7 percent. Half the time buys three words out of a thousand, and the exception is worth knowing before you pick a number for a 1,000-page backlog.
The test below uses a real 30-page PDF (a breed standard published by the FCI) rendered to images, with the PDF's own text layer as ground truth. It is not a scan of paper, so real scanner noise and skew are absent. What it does measure is the part people get wrong when sizing a job: how resolution changes time and how little accuracy moves.
Setup
| Item | Value |
|---|---|
| CPU | 2 vCPU, Intel Xeon Platinum, shared |
| Memory | 1.67 GiB |
| Tesseract | 5.3.4 (distribution package), eng.traineddata 3.92 MiB |
| Renderer | pdftoppm 25.06.0, PNG output |
| Sample | pages 1 to 6, 27 to 301 reference words each |
| Mode | tesseract page.png stdout --psm 3 |
| Score | word-level match rate against pdftotext -layout, lowercased, punctuation stripped |
Scoring is by words, not characters. A word counts only if SequenceMatcher aligns it with the reference word: close spellings such as "Bulldog" against "Bouledogue" are errors, not partial credit. That is stricter than character error rate and closer to what a downstream search index actually cares about.
Time per page
| Page | 150 dpi | 300 dpi | Slowdown | PNG size at 150 / 300 dpi |
|---|---|---|---|---|
| 1 (cover) | 0.41 s | 0.68 s | 1.7x | 197 / 388 KB |
| 2 | 1.38 s | 1.80 s | 1.3x | |
| 3 | 1.30 s | 2.70 s | 2.1x | |
| 4 | 1.16 s | 1.64 s | 1.4x | |
| 5 | 1.09 s | 1.82 s | 1.7x | |
| 6 (dense) | 1.78 s | 5.86 s | 3.3x | |
| Six pages | 7.1 s | 14.5 s | 2.0x |
Two things to read from this table. First, the ratio is not constant: doubling resolution costs 1.3x on a light page and 3.3x on a dense one, because Tesseract's cost tracks the number of glyphs it has to segment, not the pixel count alone. Second, the absolute numbers move a little between runs on shared vCPUs; the same page measured 1.16 s and 2.14 s in two runs at 150 dpi. Treat these as a range of 1.1 to 2.1 seconds per page, not a constant.
Page rendering is a separate cost and is easy to forget. pdftoppm took 4.0 seconds for four pages at 300 dpi and 8.3 seconds at 150 dpi on a cold first run. On a batch job budget roughly 1 to 2 seconds per page for rendering, unless you can render in parallel with OCR.
Accuracy per page
| Page | Reference words | 150 dpi | 300 dpi | Gap |
|---|---|---|---|---|
| 1 (cover) | 27 | 88.9% | 88.9% | 0.0 |
| 2 | 263 | 99.2% | 99.6% | +0.4 |
| 3 | 301 | 99.7% | 99.7% | 0.0 |
| 4 | 266 | 100.0% | 100.0% | 0.0 |
| 5 | 233 | 99.6% | 99.6% | 0.0 |
| 6 | 289 | 98.3% | 99.7% | +1.4 |
| Body pages 2 to 6 | 1,352 | 99.4% | 99.7% | +0.3 |
The cover page is a trap for anyone reading averages: 27 words, large type, a logo. Three word errors there cost 11 points and pull the whole average down, while saying nothing about how the recogniser handles running text. Drop it and the two modes are 99.4 and 99.7 percent.
The dense page 6 is the one case where 300 dpi is clearly worth the wait, 98.3 against 99.7. That page has small print and tight leading. If your corpus looks like that, the extra resolution is not vanity.
Memory is not the constraint
Peak resident memory for a Tesseract process on a 300 dpi page was 45.5 MiB, measured through getrusage(RUSAGE_CHILDREN). The binary is 1.0 MiB, the English language model 3.92 MiB. On a 1 GB box the OCR step itself is never the thing that runs out of memory; a PDF renderer holding several full-page bitmaps at once is. That is why the batch pattern below renders one page at a time and deletes it.
Deciding whether a PDF needs OCR at all
Most "PDF to text is broken" complaints are text PDFs run through OCR, or scans run through a text extractor. One check settles it:
chars=$(pdftotext -f 1 -l 3 "$PDF" - | tr -d "[:space:]" | wc -c)
if [ "$chars" -lt 100 ]; then
echo "scan, needs OCR"
else
echo "has a text layer, use pdftotext"
fi
Below about 30 characters per page on the first three pages, there is no text layer worth extracting. Above it, OCR will be slower and worse than what the PDF already contains.
Batch script that survives a 1 GB box
#!/bin/bash
PDF="$1"; OUT="$2"
mkdir -p "$OUT" /tmp/ocrwork
pages=$(pdfinfo "$PDF" | awk "/^Pages:/ {print \$2}")
for p in $(seq 1 "$pages"); do
pdftoppm -r 150 -f "$p" -l "$p" -png -singlefile "$PDF" /tmp/ocrwork/p
tesseract /tmp/ocrwork/p.png "$OUT/page_$(printf %04d "$p")" --psm 3 -l eng
rm -f /tmp/ocrwork/p.png
done
Writing the output as files instead of stdout matters in a loop: Tesseract appends a form feed between pages on stdout, and a naive concatenation leaves stray characters in the middle of your corpus. Also note that --psm 3 assumes automatic layout detection. For a single narrow column, --psm 4 is faster and often cleaner; for one uniform block of text, --psm 6. If you need coordinates for highlighting, add -c tessedit_create_hocr=1 instead of plain text.
What a thousand pages costs
| Resolution | OCR per page | 1,000 pages | Plus rendering |
|---|---|---|---|
| 150 dpi | 1.1 to 2.1 s | 18 to 35 min | 35 to 50 min |
| 300 dpi | 1.6 to 5.9 s | 27 to 98 min | 45 to 115 min |
On one core. The box has two, so a two-process split roughly halves it, and the honest figure for a 1,000-page backlog is somewhere between 20 minutes and an hour and a half depending on density. Compare that to a hosted OCR API billed per page and the argument for self-hosting is mostly about volume, not speed.
Two limits of this test
It is an English document. The distribution package on this system ships tesseract-langpack-eng only, and tesseract-langpack-chi_sim was not available from the configured repositories, so nothing here should be read as a claim about Chinese OCR accuracy. Chinese needs the language pack installed from another source and its own measurement.
It is also a rendered PDF page, not a photographed one. Skew, shadow, and JPEG artefacts from a phone camera will move accuracy more than the 150-to-300 dpi choice did. If your input is photos, spend the effort on deskewing before you spend it on resolution.
FAQ
Is 300 dpi ever the wrong answer for text? Only for speed. Tesseract's docs recommend roughly 300 dpi for scanned text and that is a safe default; the measurement above says 150 dpi already reaches 99.4 percent on clean, large-type documents and halves the time.
Can I run Tesseract in a Docker image? Yes, and the image is small enough to matter: the recogniser plus one language model is under 5 MiB. Use the same -l and --psm flags; the OCR behaviour is identical, only the filesystem paths change.
Does a GPU help? Not for Tesseract, which is CPU-only. It matters for learned OCR models such as PaddleOCR or docTR, where the detector is the expensive part.
How do I check output quality without a text layer? OCR one page, read it, and look for two signals: repeated single characters where a logo sits, and line breaks in the middle of sentences. Both usually mean the page needs different --psm or a deskew, not more dpi.
Related
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.