PyMuPDF4LLM
the six Ws · specification
Developers building RAG pipelines who need clean text and structure extracted from PDFs and other documents.
PyMuPDF4LLM converts PDFs and other documents into structured Markdown, JSON, or plain text optimized for RAG and LLM ingestion, including table and layout handling.
Used as a Python library built on PyMuPDF, running entirely locally without requiring GPU or cloud services.
Released around 2024 by Artifex Software and actively maintained as of 2026.
Preserves reading order, tables, and layout from complex PDFs so downstream LLMs get cleaner context than raw text extraction.
Built directly on the PyMuPDF library and integrates with frameworks like LlamaIndex and LangChain.
Open source under GNU AGPLv3 with a paid commercial license available from Artifex Software; runs entirely locally with no data sent externally.
works with