← PDF: all libraries Β· Reader board

PyMuPDF vs pypdfium2: which one reads more real-world PDF files?

PyMuPDF 2.1 and pypdfium2 5.15.0 on the same 1,077 odd real-world files from Mozilla pdf.js test PDFs (bug reports, fuzzers, broken exporters). Measured, not opinion; re-tested by itself on every new PyPI release. Updated 06 November 2026.

More files readPyMuPDF711 vs 663
Faster on this setpypdfium210.0 s vs 13.2 s total (about as fast)
Both read655only PyMuPDF: 56 Β· only pypdfium2: 8

PyMuPDF got text from more files: 711 vs 663 of 1,077. PyMuPDF broke (error, hang or crash) on 3 files that pypdfium2 read; pypdfium2 broke on 3 files that PyMuPDF read.

LibraryText fromπŸ”΄ Fails where
the other reads
🟑 Empty where
the other reads
⏱ Hangs or
crashes
Median
ms/file
Total
seconds
PyMuPDF 2.1711350213.2
pypdfium2 5.15.06633530110.0

Files only PyMuPDF reads (56)

Brotli-Prototype-FileA.pdfpypdfium2: PdfiumError: Failed to load document (PDFium: Success).
Embedded_font.pdfpypdfium2: no text
annotation-tx.pdfpypdfium2: no text
annotation-tx2.pdfpypdfium2: no text
annotation-tx3.pdfpypdfium2: no text
annotation_hidden_noview.pdfpypdfium2: no text
bug1250079.pdfpypdfium2: PdfiumError: Failed to load document (PDFium: Data format error).
bug1606566.pdfpypdfium2: PdfiumError: Failed to load document (PDFium: Data format error).
bug1675139.pdfpypdfium2: no text
bug1724918.pdfpypdfium2: no text
bug1770750.pdfpypdfium2: no text
bug1782564.pdfpypdfium2: no text
bug1796741.pdfpypdfium2: no text
bug1802506.pdfpypdfium2: no text
bug1802888.pdfpypdfium2: no text
bug1811510.pdfpypdfium2: no text
bug1825002.pdfpypdfium2: no text
bug1844576.pdfpypdfium2: no text
bug1844583.pdfpypdfium2: no text
bug1851498.pdfpypdfium2: no text
bug1865341.pdfpypdfium2: no text
bug1871353.1.pdfpypdfium2: no text
bug1871353.pdfpypdfium2: no text
bug1922766.pdfpypdfium2: no text
bug1934157.pdfpypdfium2: no text
bug2026037.pdfpypdfium2: no text
bug2055455.pdfpypdfium2: no text
checkbox_no_appearance.pdfpypdfium2: no text
dates_save.pdfpypdfium2: no text
evaljs.pdfpypdfium2: no text
freetext_no_appearance.pdfpypdfium2: no text
freetexts.pdfpypdfium2: no text
issue15716.pdfpypdfium2: no text
issue15815.pdfpypdfium2: no text
issue15818.pdfpypdfium2: no text
issue16021.pdfpypdfium2: no text
issue16473.pdfpypdfium2: no text
issue16633.pdfpypdfium2: no text
issue17333.pdfpypdfium2: no text
issue17998.pdfpypdfium2: no text

…and 16 more: see each library's page.

Files only pypdfium2 reads (8)

auth-event-ef-open.pdfPyMuPDF: ValueError: document closed or encrypted
encrypted-attachment.pdfPyMuPDF: ValueError: document closed or encrypted
issue11144_reduced.pdfPyMuPDF: no text
issue9418.pdfPyMuPDF: no text
poppler-67295-0.pdfPyMuPDF: RuntimeError: code=7: Invalid number of pages
poppler-91414-0-53.pdfPyMuPDF: no text
poppler-91414-0-54.pdfPyMuPDF: no text
recursiveCompositGlyf.pdfPyMuPDF: no text

Don't want to run it yourself? I also run PDF & Document to Markdown as a pay-per-use API on Apify (it uses pdfplumber and pypdfium2 for PDFs, markitdown for Office files). Disclosure: that tool is mine; the rankings above come only from the measurements.

What this does not tell you

This compares not breaking: whether each library gets any text out of each file. It does not rank text quality (reading order, tables, headings), and speed is one GitHub-hosted runner, default settings, no OCR switched on. If you need structure for RAG, also look at the output on your own files.

How this is measured