Blog · AI engineering
Document extraction benchmark: nine PDF, OCR and DOCX tools compared
Our benchmark of nine document extraction packages, from Docling and PyMuPDF to Tesseract and Mammoth, on scanned PDFs, mixed reports, certificates, invoice images and DOCX: speed, accuracy and which tool to use when.
Every answer an AI system gives about your documents is only as good as the text it extracted from them. A missed table, a scrambled column or a scanned page read as blank becomes a wrong or missing citation later.
In October 2025 we benchmarked nine document extraction packages to choose the right tool for each kind of document. This is the method and the results, as recorded at the time. Results reflect the package versions we tested in October 2025; these projects move quickly, so rerun the comparison on your own documents before you decide.
Method
We converted each document to Markdown and judged three things: content quality, accuracy, and preservation of the original structure and formatting. We also timed every extraction.
The nine packages: Docling, PDFPlumber, PyMuPDF, PDFMiner, Tesseract, EasyOCR, PaddleOCR, PythonDocx and Mammoth.
The document set: 50 documents covering five common real-world scenarios:
- Complex scanned PDF: an exam registration form with tables and a multi-column layout.
- PDF with mixed content: a report with text, tables and images.
- Certificate PDF: a visually rich certificate with stylised text.
- Invoice image: a PNG screenshot of a sales invoice.
- Standard DOCX: a technical manual with standard formatting.
Speed
Average extraction time across all 50 documents:
| Extractor | Avg. time (s) |
|---|---|
| PythonDocx | 0.050 |
| Mammoth | 0.097 |
| PDFMiner | 0.127 |
| PDFPlumber | 0.332 |
| PyMuPDF | 0.480 |
| Tesseract | 1.612 |
| EasyOCR | 8.282 |
| Docling | 8.678 |
| PaddleOCR | 21.515 |
DOCX libraries and text-layer PDF tools were fastest. OCR-based tools took far longer. Speed means little if the output is wrong, so we checked quality by document type.
Results by document type
Complex scanned PDF. This separated the tools sharply.
- Docling, Tesseract and EasyOCR extracted the text, with some character recognition and formatting errors. Docling also kept some of the table structure.
- PDFPlumber, PyMuPDF and PDFMiner extracted nothing meaningful. They read a PDF's text layer and are not built for image-only pages.
- PaddleOCR extracted text, but less accurately than the other OCR tools.
PDF with mixed content. Most tools handled this well.
- Docling, PDFPlumber, PyMuPDF and PDFMiner extracted the text with high fidelity.
- PDFPlumber and PyMuPDF also extracted the tables accurately.
- Tesseract and EasyOCR performed well too.
Certificate PDF. Every package extracted the main text. Docling, PDFPlumber and PyMuPDF best preserved the layout and formatting.
Invoice image (PNG). This needed OCR alone.
- Tesseract and EasyOCR gave the most accurate extraction; EasyOCR was slightly better on line items and prices.
- Docling also performed well.
- PaddleOCR struggled; its output was largely inaccurate and unusable.
Standard DOCX. PythonDocx and Mammoth extracted the text accurately and kept headings and lists. Docling also produced clean Markdown.
Summary
| Extractor | Success rate | Avg. time (s) | Best use |
|---|---|---|---|
| PythonDocx | 100.0% | 0.050 | DOCX files with tables |
| Mammoth | 100.0% | 0.097 | DOCX files (text only) |
| PDFMiner | 66.7% | 0.127 | Basic text extraction from PDFs |
| PDFPlumber | 66.7% | 0.332 | Text-based PDFs with tables |
| PyMuPDF | 66.7% | 0.480 | Fast text extraction from PDFs |
| Tesseract | 100.0% | 1.612 | Scanned documents and images (fastest OCR) |
| EasyOCR | 100.0% | 8.282 | Scanned documents (high-accuracy OCR) |
| Docling | 100.0% | 8.678 | All-rounder for mixed document types |
| PaddleOCR | 100.0% | 21.515 | Not recommended: failed our quality checks |
Success rate and quality are separate measures: PaddleOCR completed every extraction but failed our quality checks.
What we concluded
- For a mixed corpus, use an all-rounder. Docling performed well on every type we tested: DOCX, scanned PDFs, text PDFs and images.
- For a narrow, high-volume job, use a specialist. PythonDocx for DOCX at speed. PDFPlumber for text-based PDFs, especially with tables.
- For OCR, trade speed against accuracy. EasyOCR had a slight edge on accuracy; Tesseract was the fastest OCR tool.
- Route by document type. Detect whether a PDF has a text layer before choosing a tool; sending scanned pages to a text-layer extractor fails silently.
What we use it for
We ingest documents so that AI can answer questions about them with a citation a person can check. In our stack, an OpenETL pipeline extracts and prepares each document and feeds RelataDB, which indexes it for hybrid, graph and vector search. Autonous then answers from that index and cites each answer to its file, page and passage.
The benchmark shaped one rule we keep: extraction must preserve where text came from, not only what it says. A table flattened into prose, or a page lost to failed OCR, cannot be cited later.
Where to start
Take 20 to 50 documents that represent what you really ingest, including the worst scans. Run two or three candidate tools, compare the Markdown side by side, and check tables and page references by hand. Measure time per document on your own hardware. Then route each document type to the tool that handled it best.