What is pdf-inspector?
pdf-inspector is a Rust library from Firecrawl that does two jobs. It classifies a PDF as text-based, scanned, image-based or mixed by sampling the content streams of eight pages, in roughly 10 to 50 milliseconds, and lists which pages need OCR. For text pages it extracts positioned text and converts it to Markdown with headings, lists, tables, bold and italic, and multi-column reading order.
Firecrawl built it to keep the roughly 54% of PDFs that do not need OCR away from its OCR pipeline. Bindings exist for Python (pip install pdf-inspector), Node.js, browser WebAssembly and Rust, plus pdf2md and detect-pdf command-line tools. Optional selective OCR uses PP-OCRv6 Small, with PDFium and ONNX Runtime installed separately.
It is MIT-licensed; v1.25.2 was released on 28 September 2026 and the last commit landed on 7 October.
Is pdf-inspector worth it?
pdf-inspector is the fastest sensible first stage for a PDF ingestion pipeline: it answers whether a document needs OCR before you pay for it. Classification samples eight pages in tens of milliseconds and returns per-page routing, so a mixed 300-page report sends only its scanned pages to an expensive parser.
Firecrawl's own benchmark on the 200-document opendataloader-bench corpus puts it first among local, non-model parsers: an overall score of 0.875 against 0.873 for LiteParse, 0.735 for PyMuPDF4LLM and 0.589 for MarkItDown, with table structure at 0.814 against LiteParse's 0.693. The full corpus took 0.47 seconds on an Apple M4 Pro, against about 16 seconds for MarkItDown. These are the vendor's numbers, with configurations published in a reproducible branch, and the comparison deliberately excludes model-based parsers such as Docling and Marker.
That exclusion is the limit. Headings come from font-size ratios and tables from drawn rectangles and text alignment, which works on reports, papers and invoices produced by software but not on scans, photos or handwriting. Selective OCR exists but pulls in PDFium and ONNX Runtime as separate installs, at which point Docling or a hosted parser is the more complete tool.
The WebAssembly build is the unusual part: the same parser runs in a browser or Web Worker, so a web app can preview Markdown from an uploaded PDF without a server round trip.
Where it earns its place
A data engineer at a fintech ingesting 50,000 bank statements and filings a month
Stop sending every PDF to a paid OCR API
Run detect-pdf first and send only pages it flags to the OCR service; Firecrawl's own figure is that about 54% of PDFs need no OCR at all. The parser is free and runs on the existing workers.
A front-end developer at a legal-document startup
Show a Markdown preview of an uploaded contract before it leaves the browser
Load @firecrawl/pdf-inspector-wasm in a Web Worker and convert the file client-side; no server cost and the document is not uploaded until the user confirms.
A developer wiring PDFs into Claude Code or another coding agent
Give the agent clean text from research papers without a heavy parser
pip install pdf-inspector and call process_pdf, or run pdf2md --compact from the agent's shell; fall back to Docling for pages marked as scanned.
Before you commit
- Setup
- pip install pdf-inspector, npm install @firecrawl/pdf-inspector, the -wasm package for browsers, or cargo install pdf-inspector for the pdf2md and detect-pdf CLIs; first Markdown in a minute.
- Integrations
- Python (PyO3), Node.js and Bun (napi-rs), browser WebAssembly and Rust APIs; JSON output with positioned text items; optional PP-OCRv6 Small OCR with hosted-fallback recommendations.
- Data and privacy
- Runs entirely locally, including in the browser; the default build makes no network calls. MIT licence with no commercial limits.
- Cost at scale
- Free; CPU only on the default path. Firecrawl's benchmark processed 200 PDFs in under half a second on one laptop, so compute is rarely the bottleneck.
- Limits
- 249 open issues and pull requests; scans and photos need OCR or another parser; heading and table detection are heuristic; the benchmark leaves out model-based parsers.
What's good
- Classifies a PDF in about 10 to 50 ms with per-page OCR routing
- Top overall and table scores among local non-model parsers in Firecrawl's benchmark
- Python, Node, WebAssembly, Rust and CLI from one codebase
- No ML dependencies on the default path
What's not
- Benchmark is the vendor's and excludes model-based parsers
- Heuristic headings and tables miss unusual layouts
- OCR needs PDFium and ONNX Runtime installed separately
- No help for scans beyond routing them elsewhere
Best for
Engineers building RAG or agent pipelines over mostly digital PDFs who want local, fast extraction and a cheap scan-or-text decision.
pdf-inspector alternatives
pdf-inspector: common questions
- Is pdf-inspector worth it?
- pdf-inspector should be the first stop in any PDF pipeline, because the cheapest OCR call is the one you never make. We rate it 4.2 out of 5.
- How much does pdf-inspector cost?
- Free under the MIT licence.
- What are the downsides of pdf-inspector?
- Benchmark is the vendor's and excludes model-based parsers; heuristic headings and tables miss unusual layouts; oCR needs PDFium and ONNX Runtime installed separately; no help for scans beyond routing them elsewhere.
- Who is pdf-inspector best for?
- Engineers building RAG or agent pipelines over mostly digital PDFs who want local, fast extraction and a cheap scan-or-text decision.
- How much does pdf-inspector cost for a team or in production?
- Free; CPU only on the default path. Firecrawl's benchmark processed 200 PDFs in under half a second on one laptop, so compute is rarely the bottleneck.
- Is pdf-inspector safe for company data?
- Runs entirely locally, including in the browser; the default build makes no network calls. MIT licence with no commercial limits.
- What are the best pdf-inspector alternatives?
- The closest alternatives we have reviewed are Docling, Marker, MarkItDown and Unstructured.
Answers checked Oct 26, 2026.