OCRmyPDF vs Tesseract and 4 others, tested
25.6 s
10 scanned pages to a searchable PDF
OCRmyPDF with Tesseract. It kept the scan's JPEGs.
One scan, 6 ways to a searchable PDF
| Run | In the PDF | Text file | Seconds | MB | PDF/A | Peak MiB |
|---|---|---|---|---|---|---|
| OCRmyPDF, Tesseract | 1,845 | 1,876 | 25.6 | 6.49 | yes | 512 |
| Tesseract alone | 1,875 | 1,878 | 31.6 | 6.52 | no | 135 |
| OCRmyPDF, RapidOCR | 1,862 | 1,895 | 46.8 | 6.49 | yes | 2,916 |
| OCRmyPDF, EasyOCR | 1,576 | 1,210 | 41.6 | 6.49 | yes | 1,777 |
| Plain ocrmypdf, EasyOCR plugin installed | 1,576 | 1,210 | 44.4 | 6.49 | yes | 1,798 |
| PyMuPDF | 1,872 | none | 16.2 | 50.07 | no | 376 |
Words: true words found in order, of 1,955. In the PDF: what pdftotext copies out. Text file: the tool's own .txt.
Tesseract alone read one page at a time. OCRmyPDF ran 2 pages at once. CPU time: 22.9 s against 35.6 s.
The 6 commands, as run (paths shortened, in a venv)
ocrmypdf --ocr-engine tesseract --jobs 2 --sidecar out.txt scan.pdf out.pdf
OMP_THREAD_LIMIT=2 tesseract list.txt out -l eng --psm 3 --dpi 300 pdf txt
ocrmypdf --ocr-engine rapidocr --jobs 2 --sidecar out.txt scan.pdf out.pdf
OMP_NUM_THREADS=2 ocrmypdf --ocr-engine easyocr --jobs 2 --sidecar out.txt scan.pdf out.pdf
ocrmypdf --jobs 2 --sidecar out.txt scan.pdf out.pdf
OMP_THREAD_LIMIT=2 python3 -I -c "$MUPDF" scan.pdf out.pdf /opt/homebrew/share/tessdata
$MUPDF is the PyMuPDF script further down.
Which one to use
- Searchable PDF from a scan: OCRmyPDF with Tesseract.
- Most words in the text file, and you can wait: OCRmyPDF with RapidOCR.
- Speed over file size: PyMuPDF.
- Text only, from images: Tesseract alone, or pytesseract.
- Book pages: skip EasyOCR.
ocrmypdf --ocr-engine tesseract --jobs 2 --sidecar out.txt scan.pdf out.pdf
Name the engine: plain ocrmypdf can run another one, as
the trap below shows.
Tesseract alone reads images, not PDFs
- Nearly the same words in its text file, and its PDF copied out better.
- But it does not open a PDF. Pull the page images out first:
pdfimages -j scan.pdf page
ls page-*.jpg > list.txt
OMP_THREAD_LIMIT=2 tesseract list.txt out -l eng --psm 3 --dpi 300 pdf txt
-
You get no PDF/A, no
--deskew, and no skip of pages that already have text (OCRmyPDF's flags). - pytesseract is a Python wrapper that runs the same tesseract program.
The EasyOCR plugin takes over plain ocrmypdf
Installing ocrmypdf-easyocr changes plain ocrmypdf. Its
own code says it runs for the default --ocr-engine auto
too.
- Words in the PDF: 1,845 with Tesseract, 1,576 with the plugin.
-
Fix: pass
--ocr-engine tesseract, or install the plugin in its own venv.
EasyOCR reads boxes, not lines
Printed: "Keep your head, Hatton," commanded Hardy; "don't talk tommyrot.
The EasyOCR plugin's text file: Boy Air Scouts of the 86 The Keep Hatton; commanded head, 9} (( your Hardy;
It wrote its boxes out of line order. In order, its text file held 1,210 of 1,955 words.
More on boxes and lines: EasyOCR vs Tesseract.
OCRmyPDF can run PaddleOCR's models
pip install "ocrmypdf[rapidocr]" makes
--ocr-engine rapidocr work (I installed 17.14.2 with uv).
RapidOCR 3.10.0 runs PaddleOCR's PP-OCRv6 small models on ONNX
Runtime.
- The most words in a text file of the 6 runs (1,895). Its PDF copied out 1,862.
- But 1.8 times the time of OCRmyPDF with Tesseract, and the most memory of the 6.
- A separate plugin, ocrmypdf-paddleocr 0.1.1, runs PaddleOCR itself. It needs paddleocr and paddlepaddle below 3.3. Not run here.
PyMuPDF: fastest, but 7.7 times the file
This PyMuPDF recipe renders each page at 300 dpi, then OCRs that picture with MuPDF's built-in Tesseract.
The PyMuPDF script, as run
import sys, pymupdf
src, dst, td = sys.argv[1:4]
doc, out = pymupdf.open(src), pymupdf.open()
for page in doc:
pix = page.get_pixmap(dpi=300)
out.insert_pdf(pymupdf.open("pdf", pix.pdfocr_tobytes(language="eng", tessdata=td)))
out.save(dst, garbage=3, deflate=True)
- Fastest here, and its PDF layer nearly matched Tesseract alone.
- But the JPEGs are gone: each page is a new picture.
- PyMuPDF is AGPL-3.0, or a paid Artifex license.
Text only, no PDF: earlier runs
| Tool | Words, of 1,955 | Run |
|---|---|---|
| PaddleOCR 3.7.0 | 1,919 | Earlier run, Nov 22 |
| Our Actor's code | 1,877 | Earlier run, Nov 27 |
| Docling (docling-mcp 3.5.1, auto OCR) | 1,855 | Earlier run, Nov 27 |
| EasyOCR 1.7.2 alone, paragraph=True | 1,658 | Earlier run, Nov 14 |
- PaddleOCR ran on the CPU with 2 threads and took 587.5 s on a busy Mac: PaddleOCR in Python.
- Docling picked RapidOCR on torch: 4.5 s a page on a second call, 3,717 MiB at peak: docling-mcp, tested.
No OCR install: our Actor, text out
Our Apify Actor, PDF to Markdown OCR, runs Tesseract on scans (RapidOCR rereads a page Tesseract reads badly), with no OCR install. Its code found 1,877 of these 1,955 words.
The API call (not run for this test)
curl -s -X POST "https://api.apify.com/v2/acts/brasspage~pdf-ocr-to-markdown/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"documentUrls": ["https://example.com/your-file.pdf"]}' \
| jq -r '.[].markdown' > out.md
- $0.006 per OCR page, plus $0.00005 a run at the default 1 GB. Pages read from their own text layer are free.
- Runs bill to your Apify account. Your files go to Apify's servers.
- I ran its code at commit d6085581 on this Mac, not on Apify.
What I tested, and what I did not
- One clean scan of book prose, on one Mac. Times are rough: other jobs shared the Mac.
- Marked PDF/A: the file carries the PDF/A tag. I did not check it with veraPDF.
- Not tested: tables, phone photos, Windows and Linux.
How I tested
- Scan: 10 proofread book pages from English Wikisource, 1,955 true words.
- Each page is a 1920 px JPEG at 300 dpi. The PDF is 6.49 MB.
- Score: true words found in order, with exact case and punctuation (curly and straight quotes count as one), the scorer of my other OCR pages.
- One run at a time, at background priority, with 2 jobs or 2 threads, on an Apple silicon Mac.
- All 6 ran between 21:20 and 21:25 MST.
- OCRmyPDF 17.14.2, Tesseract 5.5.4, PyMuPDF 2.2.
- RapidOCR 3.10.0 on ONNX Runtime 1.32.0.
- ocrmypdf-easyocr 0.3.0 with EasyOCR 1.7.2 and torch 2.15.0, on the Mac GPU.
- PDF/A: I read the pdfaid tag in each file's XMP. No Ghostscript on this Mac. OCRmyPDF logged "Speculative PDF/A conversion succeeded - skipping Ghostscript".
- The timed Tesseract run read the scan's JPEGs. pdfimages -j gave back the same 10 files, byte for byte.
- The earlier rows used the same scan and scorer, with their own settings. EasyOCR alone, with paragraph=True: EasyOCR on a scanned book.
Sources and licenses
- OCRmyPDF: MPL-2.0.
- ocrmypdf-easyocr: MIT. Its _plugin.py, get_ocr_engine, says it runs for the default auto as well.
- ocrmypdf-paddleocr 0.1.1 on PyPI: MPL-2.0.
- Tesseract: Apache-2.0.
- EasyOCR: Apache-2.0.
- RapidOCR: Apache-2.0.
- PaddleOCR: Apache-2.0.
- PyMuPDF: AGPL-3.0, or a paid license from Artifex.
- Docling: MIT.
- Scripts and results stay in our private repo, in research/bench/ocrmypdf-vs-2026-11-27/.
- We make the Apify Actor, not these tools.
Questions people ask
Is OCRmyPDF better than Tesseract?
For a scanned PDF, yes. It opens the PDF itself and marked the file PDF/A. Same engine, so the text files match (1,876 against 1,878), but its PDF copied out 30 fewer words (1,845 against 1,875). Both kept the JPEGs.
Why did ocrmypdf get worse after I installed ocrmypdf-easyocr?
The plugin also runs for the default --ocr-engine auto, so plain ocrmypdf used EasyOCR. Pass --ocr-engine tesseract, or install the plugin in its own venv.
Can OCRmyPDF use PaddleOCR?
Yes. --ocr-engine rapidocr runs PaddleOCR's PP-OCRv6 small models through RapidOCR. It found the most words in a text file of the 6 runs, at nearly twice the time.
Is PyMuPDF OCR faster than OCRmyPDF?
In this test, yes: 16.2 s against 25.6 s. But its PDF was 50.07 MB, against 6.49 MB, and PyMuPDF is AGPL-3.0 or a paid license.