pypdf vs pdfplumber vs PyMuPDF vs pdfminer.six, on the same files
Updated · Tested with Python 3.13, pypdf 7.2.0, PyMuPDF 2.2, pdfplumber 0.11.11, pdfminer.six 20260107
In short
pypdf gives the cleanest lines and needs no other package. PyMuPDF was about six times faster and can render pages, but its licence is AGPL. pdfplumber and pdfminer.six read a font that the other two return as gibberish, and pdfplumber adds positions and tables. None of the four reads a scan.
Most comparisons of these libraries quote speed figures from different files and machines. Here all four read the same eight files, which you can download and run yourself. The code for the basic call of each library is in how to extract text from a PDF in Python.
The results
| Test | pypdf | PyMuPDF | pdfplumber | pdfminer.six |
|---|---|---|---|---|
| Labels and values on one line | One line, with a space | Separate lines | One line, with a space | Separate lines |
| Two-column page | Column by column | Column by column | Across both columns | Paragraphs out of order |
| Ligatures (fi, ffi, fl) | Correct | Correct | Correct | Correct |
| Font without a Unicode map | Gibberish | Gibberish | Correct | Correct |
| Hebrew line | Order partly wrong | Order partly wrong | Reversed | Reversed |
| Values in form fields | Not in the text | In the text | Not in the text | Not in the text |
| Scanned page | Empty | Empty | Empty | Empty |
| 200 pages | 0.56 s | 0.09 s | 1.21 s | 0.92 s |
The files: company-extract.pdf, report-two-columns.pdf, no-unicode-map.pdf, hebrew-extract.pdf, form-fillable.pdf and company-scan.pdf. The 200-page file is the first sample repeated.
What the rows mean
Labels and values. The first sample sets each label and its value in two columns of one line. pypdf and pdfplumber return Company name Harbor Lane Logistics Ltd. PyMuPDF and pdfminer.six return the label and the value on separate lines, because they work in blocks of text. With PyMuPDF, page.get_text(sort=True) puts them back on one line.
Two columns. pdfplumber reads straight across the page, so it joins the first line of the left column to the first line of the right. pypdf and PyMuPDF finish the left column first. pdfminer.six keeps each paragraph whole but mixes the paragraphs of the two columns. Keeping columns and lines in order shows the fix.
Ligatures. In many fonts, "fi" or "ffi" is drawn as one joined shape. All four libraries turned those shapes back into letters: "office", "fleet", "staff".
Font without a Unicode map. Some PDFs leave out the table that says which letter each shape stands for. pypdf and PyMuPDF then return the shape numbers as if they were letters:
&203$1<(;75$&7pdfplumber and pdfminer.six, which share one engine, read the font itself and returned COMPANY EXTRACT. More in why you can't copy text from some PDFs.
Hebrew. The sample stores each Hebrew line in the order it is drawn, left to right. pdfplumber and pdfminer.six return it exactly so, which is fully reversed and easy to repair. pypdf and PyMuPDF try to reorder it and get plain lines right, but put the pieces of a line with a number or an English name in the wrong order. Why Hebrew text comes out backwards has the repair.
Form fields. Only PyMuPDF includes the values typed into a fillable form when you ask for the page's text. The others need a separate call; see extracting data from PDF forms.
Scans. No PDF library reads a picture of text. That is a job for OCR.
Beyond text
| Feature | pypdf | PyMuPDF | pdfplumber | pdfminer.six |
|---|---|---|---|---|
| Position of each word | With extra code | Yes | Yes | Yes |
| Finds tables | No | Yes | Yes | No |
| Renders pages to images | No | Yes | Yes | No |
| Splits, merges, encrypts | Yes | Yes | No | No |
| Pure Python, no other packages | Yes | No | No | No |
| Licence | BSD | AGPL, or paid | MIT | MIT |
Which to choose
- pypdf for most jobs: clean lines, pure Python, a permissive licence, and it also splits and merges files.
- PyMuPDF when you process many pages or need to render them, and its AGPL licence suits your project.
- pdfplumber when you find values by position or pull tables out of pages.
- pdfminer.six rarely on its own; you get it through pdfplumber.
A sensible default is pypdf first and pdfplumber as the second opinion, since each rescues a file the other fails on.
Where 100sands fits
These libraries are the right tool for text PDFs, and 100sands reads the same kind of file: PDFs and HTML files that contain text. What it adds is one reading that holds across the rows above. It returns each label and its value on one line, separated by a tab, puts Hebrew and Arabic lines in reading order with numbers and English names in place, and reads the font when the Unicode map is missing. It also returns your own named fields from documents of a kind you set up once.
It shares the libraries' limits on three rows. It does not read scans: company-scan.pdf is refused with status 422 and the code NO_TEXT_IN_FILE, and reading it needs an OCR tool. It does not read the values typed into fillable form fields. And like pdfplumber, it reads a two-column page straight across, with a tab between the columns on each line. The PDF to text API page has the call.