How to Convert PDF to Text
The free offline way is pdftotext: one command turns a text-based PDF into a plain-text file. Tested 2 November 2026 with pdftotext 24.02.0 (Poppler) — a 2-page text PDF extracted both pages cleanly, while an image-only PDF of 76,642 bytes extracted just 1 byte: nothing. That boundary is the whole guide: pdftotext reads the PDF's text layer, and a scanned page has no text layer to read.
At a glance
- pdftotext only extracts text that is already in the PDF. A scanned or photographed page has no text layer, so the output is empty — that is expected, not an error.
- In the test, the text PDF gave back both lines verbatim, including the second page. The image-only PDF gave back 1 byte (an empty line).
- Use
-layoutwhen column positions matter; plain mode reflows text and can scramble tables. - Clioos does not offer a PDF-to-text tool. PDF Probe converts PDF tables to Excel or CSV, which is a different job from plain-text extraction.
Steps
- Install Poppler if needed (most Linux systems already have it; macOS:
brew install poppler). Check withpdftotext -v(24.02.0 in the test). - Run:
pdftotext sample.pdf sample.txt. For tables, run:pdftotext -layout sample.pdf sample.txt. - Verify: the test text PDF extracted “Quarterly report: revenue rose 12 percent in Q3.” and “Page two: outlook for Q4 is cautiously positive.” — both pages, verbatim.
- Diagnose an empty result: run
pdftotext scanned.pdf - | wc -c. The test image-only PDF returned 1 byte — proof the page is a picture, not text. OCR it first; re-running pdftotext will not help.
Worked example (tested 2 November 2026)
Method: pdftotext 24.02.0 (Poppler), run locally on two test PDFs. No upload, no account.
| Input | Result |
|---|---|
| sample-text.pdf, 2 pages with a real text layer | Both lines extracted verbatim: “Quarterly report: revenue rose 12 percent in Q3.” and “Page two: outlook for Q4 is cautiously positive.” |
| scanned-style.pdf, image-only, 76,642 bytes | Output was 1 byte — empty. No text layer, nothing to extract. |
The difference is not quality; it is kind. One PDF contains text, the other contains a picture of text, and pdftotext can only return what is there.
What it can't do
- No OCR: pdftotext cannot read text out of a scanned image. Scanned pages need an OCR step first — consistent with our scanned-PDF guide, which states the same boundary.
- No table structure: plain mode loses columns.
-layoutpreserves positions, but the result is still text, not a spreadsheet. For tables, use a PDF-to-Excel tool instead. - No Clioos tool for this: Clioos does not offer PDF-to-text extraction. PDF Probe converts tables to Excel or CSV; this guide's method is the free offline route.
- No formatting: bold, fonts, colours and images are dropped. The output is characters only.
Frequently asked questions
Is pdftotext free?
Yes — part of Poppler, free and open source, runs offline on your own computer.
Why did my PDF extract nothing?
Almost certainly it is image-only (a scan or photo). Check with pdftotext to stdout and count the bytes: near-zero means no text layer. OCR the PDF first.
Can pdftotext convert a PDF table to Excel?
No — it outputs text. For a spreadsheet, use a PDF-to-Excel converter; -layout only keeps the visual positions in text form.
Does it work on encrypted PDFs?
Only if you supply the password (pdftotext -upw). Without it, an encrypted PDF extracts nothing.
Related guides: How to convert a scanned PDF to Excel · How to convert PDF to Excel · How to convert PDF to Word · All guides · Tool: PDF Probe