← PDF: all libraries · Reader board
pypdf vs PyMuPDF: which one reads more real-world PDF files?
pypdf 7.0.0 and PyMuPDF 2.1 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.
PyMuPDF got text from more files: 711 vs 664 of 1,077. pypdf broke (error, hang or crash) on 7 files that PyMuPDF read; PyMuPDF broke on 2 files that pypdf read.
| Library | Text from | 🔴 Fails where the other reads | 🟡 Empty where the other reads | ⏱ Hangs or crashes | Median ms/file | Total seconds |
|---|---|---|---|---|---|---|
| pypdf 7.0.0 | 664 | 7 | 49 | 0 | 4 | 145.8 |
| PyMuPDF 2.1 | 711 | 2 | 7 | 0 | 2 | 13.2 |
Files only pypdf reads (9)
| annotation-text-without-popup.pdf | PyMuPDF: no text |
| crypt_filters.pdf | PyMuPDF: FileDataError: Failed to open file '/home/runner/work/reader-board/reader-board/corpora/pdfjs/crypt_filters.pdf' as type pdf. |
| issue11144_reduced.pdf | PyMuPDF: no text |
| issue19326.pdf | PyMuPDF: no text |
| issue9418.pdf | PyMuPDF: no text |
| poppler-67295-0.pdf | PyMuPDF: RuntimeError: code=7: Invalid number of pages |
| poppler-91414-0-53.pdf | PyMuPDF: no text |
| poppler-91414-0-54.pdf | PyMuPDF: no text |
| recursiveCompositGlyf.pdf | PyMuPDF: no text |
Files only PyMuPDF reads (56)
| annotation-tx.pdf | pypdf: no text |
| annotation-tx2.pdf | pypdf: no text |
| annotation-tx3.pdf | pypdf: no text |
| annotation_hidden_noview.pdf | pypdf: no text |
| bomb_giant.pdf | pypdf: DependencyError: jbig2dec binary is not available. |
| bug1250079.pdf | pypdf: PdfStreamError: Stream has ended unexpectedly |
| bug1675139.pdf | pypdf: no text |
| bug1724918.pdf | pypdf: no text |
| bug1770750.pdf | pypdf: no text |
| bug1782564.pdf | pypdf: no text |
| bug1796741.pdf | pypdf: no text |
| bug1802506.pdf | pypdf: no text |
| bug1802888.pdf | pypdf: no text |
| bug1811510.pdf | pypdf: no text |
| bug1825002.pdf | pypdf: no text |
| bug1844576.pdf | pypdf: no text |
| bug1844583.pdf | pypdf: no text |
| bug1851498.pdf | pypdf: no text |
| bug1865341.pdf | pypdf: no text |
| bug1871353.1.pdf | pypdf: no text |
| bug1871353.pdf | pypdf: no text |
| bug1922766.pdf | pypdf: no text |
| bug1934157.pdf | pypdf: no text |
| bug2026037.pdf | pypdf: no text |
| bug2055455.pdf | pypdf: no text |
| checkbox_no_appearance.pdf | pypdf: no text |
| dates_save.pdf | pypdf: no text |
| evaljs.pdf | pypdf: no text |
| freetext_no_appearance.pdf | pypdf: no text |
| freetexts.pdf | pypdf: no text |
| issue10175.pdf | pypdf: DeprecationError: The filter name /A85 is deprecated and has been removed in pypdf 7.0.0. Use /ASCII85Decode instead. |
| issue15716.pdf | pypdf: no text |
| issue15815.pdf | pypdf: no text |
| issue15818.pdf | pypdf: no text |
| issue16021.pdf | pypdf: no text |
| issue16473.pdf | pypdf: no text |
| issue16633.pdf | pypdf: no text |
| issue17998.pdf | pypdf: no text |
| issue18536.pdf | pypdf: no text |
| issue18561.pdf | pypdf: no text |
…and 16 more: see each library's page.
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
- Each library runs a short recipe from its own docs (board/targets.py):
open the file, get all text. Installed with the extras the docs recommend for reading
(
pypdf[full]: AES decryption, Brotli), nothing else. One worker process per CPU; per file 60 s / 120 s / 180 s / 300 s / 600 s at most (the any-document table allows longer: some tools load models), killed above the memory limit. - Fails where another reads: the library raised an error, hung or crashed on a file from which another library in the same table got text. Files that every library fails on (encrypted, truncated, fuzzed) are not counted against anyone.
- Empty where another reads: no error, but no text. This is often the recipe, not the library: for example
python-docx's paragraphs+tables recipe skips headers, text boxes and nested tables. Check the file list. - Any document → text: a file type the tool's docs don't list, or that the tool itself rejects as unsupported, counts as "not supported", not as a failure (lists in board/libs.json). Returning a file's raw RTF source counts as empty, for every tool. Each tool runs with default settings: no OCR switched on by hand.
- OCR: each image comes with the human-written ground-truth text published with its dataset. Words found is the share of its words that appear anywhere in the engine's output (reading order doesn't matter); an image that fails or comes back empty counts as 0. The ground truth of receipts and document pages covers only their annotated text, so a character error rate would punish engines for reading more than was annotated; it is in the raw results but not ranked. English models, CPU, default settings.
- Speech: each clip comes with its dataset's reference transcript. Both texts go through Whisper's English text normalizer (case, punctuation, "twenty" = "20"); word error rate is all substituted, missing and extra words over all reference words, the usual corpus-level WER. A clip that fails or comes back empty counts all its words as errors. The three Whisper implementations use the same base.en model; each other engine its documented default model. English, CPU, default decoding settings.
- Language detection: each text's language is known from Tatoeba. An answer counts as correct if the library's code matches after mapping variants to ISO 639-1 (zh-cn → zh, nb → no, iw → he). Close languages count as different: Croatian detected as Bosnian or Serbian, or Norwegian as Danish, is wrong. One call per text with default settings and all languages enabled.
- PDF → Markdown: pages from AI2's olmOCR-bench (ODC-BY), scored with its own checks (vendored, Apache-2.0): a sentence must be present, a page header or footer absent, two passages in the right order, a table cell next to the right neighbour. Checks passed is all passed checks over all checks; a page that fails or comes back empty passes none. Math pages are left out (their checks need a browser to render formulas). Default settings: whatever OCR a tool does on its own, it does.
- Text quality (order, tables, layout) is not ranked in the other tables; they are about not breaking. The raw results have every output's size and hash.
- Same files for every version: the test collections are pinned to one commit. GitHub-hosted runner, so times are comparable within one table, roughly.