PyMuPDF 2.0: Consolidation, Not Complication

October 19, 2026

PyMuPDF 2.0

Up until now, getting clean, well grounded, LLM-ready content out of a PDF with PyMuPDF has meant assembling a selection of libraries. You installed PyMuPDF for the engine. You added PyMuPDF4LLM to extract pages as structured data ready for LLM consumption and pre-processing. Then, to get real layout understanding (reading order, headers and footers, tables, multi-column pages), you added PyMuPDF Layout and remembered to import it before anything else, in exactly the right order.

It worked, and it worked fast. But it was three packages, three version numbers, and one import-order rule that caught out more developers than we'd like to admit.

PyMuPDF 2.0 ends that. PyMuPDF4LLM and PyMuPDF Layout are now part of PyMuPDF itself. One package, one installation, one import — consolidation giving you structure-aware document parsing all from one import.

Why we did it

Every other library import is a place where things can go wrong or just appear suboptimal. We’ve watched users pin three separate versions and hope they matched. We’ve understood that many users just imported PyMuPDF without even appreciating the strength of the other offerings. We’ve seen bug reports that were really things which could have been resolved if the whole suite of PyMuPDF libraries were used in the first place. We’ve seen people install PyMuPDF without PyMuPDF4LLM and conclude the output wasn't as good enough (without realising how good it could be).

The tools had grown up together. It no longer made sense to ship them apart. AI first solutions and Layout-aware extraction isn't an add-on anymore. It's now what people expect when they open a document, so it now ships as part of the core

What this looks like in practice

Before:

# pip install pymupdf pymupdf4llm pymupdf-layout
import pymupdf.layout      # must come first
import pymupdf 
import pymupdf4llm 

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

After:

# pip install pymupdf
import pymupdf

doc = pymupdf.open("report.pdf")
md = doc.to_markdown()

That's it. GNN powered Layout analysis is on by default. Markdown, JSON, and plain-text output are built in. Nothing to remember and nothing to line up.

What you get, out of the box

Layout that understands PDFs, not pictures of PDFs. Most layout tools render each page to an image and run a vision model over it. PyMuPDF's layout engine works directly on the document's internal structure using graph neural networks, which is how it stays fast and accurate without a GPU.

Reading order you can trust. Multi-column papers, sidebars, and footnotes come out in the order a human would read them. Headers and footers can be detected and removed so they don't pollute your chunks.

Smart OCR. Pages are inspected before extraction. Only the regions that need OCR get it, and the recognised text is merged back into the page alongside the existing digital content. You spend OCR time only where it pays off.

Output built for LLMs. Markdown for prompts and chunkers, JSON with bounding boxes and element types for structured pipelines, and plain text when you just need the words. Page chunking with metadata is ready for your vector store.

Framework integrations. LlamaIndex and LangChain support come along for the ride.

Still CPU-only, still fast. No GPU, no cloud calls, no model server. If it runs Python, it runs PyMuPDF.

No cloud required: PyMuPDF runs entirely on your own machine, so your documents never leave your environment. There are no API keys, no per-page fees, and no network latency, and it works just as well on an air-gapped server as anywhere else.

Upgrading

If you're already using PyMuPDF4LLM, your existing code keeps working: import pymupdf4llm remains available as a compatibility layer. In short, if you install PyMuPDF 2.0 you won’t need to change your existing code.

What hasn't changed

The MuPDF engine underneath. The speed. The licensing model. And everything you already use PyMuPDF for (rendering, editing, redaction, annotations, conversion) works just as before.

One library for the whole job

PyMuPDF started as the fastest way to open and manipulate PDFs in Python. With 2.0, it's also the simplest way to turn any document into something which gives better grounded results - perfect for an LLM to quickly use, with no assembly required.

pip install --upgrade pymupdf

Try it on your messiest PDF, and tell us what you think!




Discuss This Article with the Community

Have a question, a different approach, or something you built after reading this? Share it on the forum or join the Discord, we'd love to hear from you.

PyMuPDF Logo

© 2026 Artifex Software Inc. All rights reserved.