What is PyMuPDF?

PyMuPDF is a layout-aware document engine for AI and a feature-rich Python toolkit for extracting, rendering and editing PDFs and other documents. Since version 2.0, its ML-based layout analysis turns PDFs and Office files into high-quality Markdown for RAG and agents, running fast on CPU and grounding every result to its source page.

Last updated

Key facts

Type
Python library for PDF and document processing
Developer
Artifex Software, Inc., which also develops MuPDF and Ghostscript
Built on
MuPDF, a C engine for PDF and document processing
Install
pip install pymupdf
Import
import pymupdf
Platforms
Windows, macOS and Linux
Licence
Open source under AGPL-3.0, or a commercial licence from Artifex for proprietary use
Hardware
Runs on CPU. No GPU, cloud service or API key needed.
Input formats
PDF, XPS, EPUB, CBZ, MOBI, FB2, SVG, TXT, Markdown and images. Microsoft Office and Hangul files need PyMuPDF Office.
Output formats
Markdown, JSON, plain text, HTML, images, SVG and PDF
Integrations
LangChain and LlamaIndex document loaders
PyMuPDF Logo

© 2026 Artifex Software Inc. All rights reserved.