PyMuPDF vs Docling

A faster, lighter parser
alternative to Docling

PyMuPDF and Docling solve the same problem of turning PDFs into structured, LLM-ready output, but with opposite engineering philosophies. One is a lightweight engine you drop into anything. The other is a machine-learning pipeline built for a different set of trade-offs.

Let's explore the differences in install footprint, speed, ecosystem, and when to choose each.

PyMuPDF vs Docling

Install size

Lowest footprint works best for containers, serverless, and at scale

Docling

6.1GBdefault install
  • A Torch-based ML pipeline
  • CUDA wheels included by default

Includes CUDA wheels by default

Models load at runtime

Larger surface to containerize & deploy

PyMuPDF

64MBinstall size
  • A C-based PDF engine
  • Layout model on top

Runs anywhere Python runs

No GPU required

No model downloads

Install size compares each package's default distribution; Docling's figure includes the CUDA wheels pulled in by its default install.

Speed

Fastest parsing core in the benchmark set

PyMuPDF

1.18s

vs PyPDF

35x

vs Markitdown

75.7x

Docling

N/A

Architectural Reason

PyMuPDF's parsing core is MuPDF, a C library. The layout model sits on top as a compact ONNX network. Docling routes documents through a Python and Torch pipeline with model loading at startup.

PyMuPDF architecture

The independent testing above, conducted by LlamaIndex, found PyMuPDF to be the fastest PDF parser tested.

In LlamaIndex's August 2026 benchmark, PyMuPDF processed a 100 MB, 457-page PDF in 1.18 seconds — 35× faster than PyPDF and 75.7× faster than Markitdown. Docling wasn't included in the test.

This test measured standard PyMuPDF without its advanced layout features. The quality results below use the full PyMuPDF stack.

Ecosystem & maturity

The default PDF layer of the
Python ecosystem

Docling

18.0M

monthly downloads (2026-07)

PyMuPDF

114.9M

monthly downloads (2026-07)

PyMuPDF4LLM package alone

22.4M

monthly downloads,
outpacing all of Docling.

Real-World Adoption

langchain-community, at 45.5M monthly downloads, ships PyMuPDF loaders. In Korea and Japan the gap widens to 7.1x and 20.6x respectively.

Real-world adoption

Ten Years of Docs and Examples

Ten years of development also means ten years of documentation: a complete API reference, recipes, and tutorials covering the full engine, not just the conversion path.

Ten years of docs and examples

Side by Side

How the two engines actually differ

Dimension
Docling
PyMuPDF
PyMuPDF4LLM
Architecture
Torch-based ML pipeline
C-based PDF engine with a layout model on top
PyMuPDF core + layout stack optimized for extraction + LLM output
Install size
6.1GB (default install, incl. CUDA wheels)
64MB
~200MB total with the layout stack
GPU
Used for inference
Not required
Not required
Model downloads
Loaded at runtime
None
None; compact ONNX layout model is bundled
Deployability
Needs a runtime that can host the model weights & CUDA stack
Runs anywhere Python runs
Runs anywhere Python runs, with a lightweight extraction stack
License
MIT
AGPL or commercial
AGPL or commercial

Switching from Docling

Same job, less code

PyMuPDF4LLM is a single function call away from Docling's conversion path.

If you're already using Docling, you can switch to PyMuPDF4LLM with minimal code changes. The conversion path is a single function call away, and the output is the same Markdown format that Docling produces.

Docling

12
from docling.document_converter import DocumentConverter
md = DocumentConverter().convert("report.pdf").document.export_to_markdown()

PyMuPDF

12
import pymupdf4llm
md = pymupdf4llm.to_markdown("report.pdf")

FAQ

Questions people ask before switching

License

The legal model matters as much as the parser

MIT License

Docling

Docling is MIT. MIT costs nothing and promises nothing. It is a legitimate model for teams prioritizing permissive licensing, but it does not include the procurement or support path that comes with the engine.

AGPL 3.0 License

PyMuPDF

PyMuPDF is AGPL 3.0 with a commercial license available. If you ship it inside a product without open-sourcing your stack, you buy a commercial license from the company that builds the engine.

Both are legitimate models; know which one your deployment needs before you standardize. The commercial license is a procurement path with support behind it, and that same company answers your support tickets and keeps the parser maintained for the next decade.

The Decision

Which one fits your stack?

If you're building agents or pipelines that need fast, deterministic, deployable parsing, PyMuPDF is the stronger fit.

GET STARTED
PyMuPDF Logo

© 2026 Artifex Software Inc. All rights reserved.