Is My PDF Text-Based or Scanned? 4 Ways to Check (Free Tool)
The classic scenario: you try to copy a paragraph from a PDF and discover you can't select any text — or extraction returns garbled characters and boxes. In almost every case that's a scanned PDF: it's really just photographs of pages, with no actual text inside.
Knowing the type matters because the two demand completely different handling:
| Type | What it is | Correct handling |
|---|---|---|
| TextBased | Real encoded characters in the content stream | Extract directly: millisecond-fast, free, 100% faithful |
| Scanned | Each page is just an image | OCR required: slow, error-prone, often paid |
Running OCR on a text-based PDF is pure waste — yet about 54% of PDFs are text-based and never needed it.
Method 1: Free online detection (fastest)
Open the home-page demo and drop in your PDF:
- A verdict in about 10–50ms:
TextBased/Scanned/ImageBased/Mixed; - A 0–1 confidence score included;
- For mixed documents, the exact list of which pages need OCR;
- Fully local in your browser — nothing is uploaded.
Why machine detection beats eyeballing
Some PDFs look like they have text but carry "fake" text — broken font encodings (CID/Type0 without ToUnicode maps) that copy out as garbage. pdf-inspector walks the font-decoding chain; such pages are flagged for OCR. You can't spot this by eye.
Method 2: One command from the terminal
After installing the CLI (install page), detect-pdf does exactly this:
detect-pdf report.pdfIt prints the classification, confidence, and the pages needing OCR — ideal for routing in batch scripts: text-based files take the fast path, the rest go to OCR.
Method 3: From code (Node.js / Python)
Node.js
const { detectPdf } = require('@firecrawl/pdf-inspector')
const result = await detectPdf('report.pdf')
console.log(result.type) // "TextBased" / "Scanned" / ...
console.log(result.confidence) // 0–1Python
from pdf_inspector import detect_pdf
result = detect_pdf("report.pdf")
print(result.type) # classification verdict
print(result.needs_ocr) # list of pages needing OCRMore detail in the API quick reference.
Method 4: Manual checks (no tools)
Three rules of thumb, right maybe eight or nine times out of ten:
- Try selecting text: if a cursor can highlight and copy words, it's probably text-based; if one drag grabs the whole page like an image, it's scanned.
- Zoom way in: at 400% scans usually show paper noise, gray backgrounds, binding shadows, or slight skew.
- Check file size: page-for-page, scans are much larger (an image per page). A suspiciously tiny "100-page document" may be an empty shell or a low-quality scan.
Where the eyeball fails
None of these catch pseudo-text: selectable, copyable — but garbage when pasted. That's a text-based PDF with broken font mappings, and only a proper detector (method 1) can identify it.
What to do after detection
A PDF arrives
│
▼ Detect (~10–50ms)
│
├─ TextBased ──────────► Extract / convert locally (free, milliseconds)
│
├─ Scanned / ImageBased ──► Send to OCR
│
└─ Mixed ──► OCR only the flagged pages; extract the rest locallyThat's selective-OCR routing, built into the native pdf-inspector packages, with per-page provenance (native / ocr / fused). The full strategy is covered in the errors & limits guide.
How do I convert a scanned PDF to text?
The browser demo includes no OCR. If your file truly is scanned:
- Use a desktop tool with OCR (e.g. Adobe Acrobat) or a cloud service;
- Or use the selective OCR built into pdf-inspector's native packages (Rust / Node.js / Python), which runs OCR only on pages rejected by quality checks.
FAQ
Text selects fine but copies out as garbage — why?
Usually missing or damaged ToUnicode CMaps on CID/Type0 embedded fonts: glyphs render correctly but the character-to-Unicode mapping is broken. Confirm with online detection; pdf-inspector handles most common CMaps and explicitly flags pages it cannot decode.What does Mixed mean?
Part of the document is native text and part is images — say, typeset body chapters plus scanned stamped appendices. Per-page routing is the cheapest path: extract text pages directly, OCR only the image ones.How should I read the confidence score?
A 0–1 float expressing how sure the classifier is. Below-threshold results deserve human review, or conservative treatment (treat as scanned). Engineering guidance lives in the troubleshooting guide.Related pages
- Online parser: detection + Markdown conversion in one place;
- PDF to Markdown guide: your next step once it's confirmed text-based;
- CLI guide: full flags for detect-pdf.