pdf-inspector — fast, open-source PDF to Markdown
Firecrawl open source · MIT
RSRust core
PDF structure,<br>built for speed.
A Rust-powered, open-source parser that classifies PDFs and turns native text into clean, position-aware Markdown. Use it from Node.js or the bundled CLI, with packages also available from PyPI and crates.io.
View on GitHub ↗<br>Try it locally ↓<br>Read the docs →
npm CLI · local
$ npm i -g @firecrawl/pdf-inspector<br>installed the native package + CLI
$ pdf-inspector annual-report.pdf<br># Annual report 2025
## Financial highlights<br>| Metric | 2025 | 2024 |<br>|---|---:|---:|
document typeTextBased<br>outputstructured Markdown<br>engineRust
npm<br>npm Node.js + CLI
npm i @firecrawl/pdf-inspector
Py<br>PyPI Python
pip install pdf-inspector
Cr<br>crates.io Rust
cargo add pdf-inspector
[ 01 / 05 ]Browser demo
Try it in<br>your browser.
Drop in a native-text PDF to classify it and turn it into Markdown. The Rust core runs locally as WebAssembly in a background worker—your document never leaves this tab.
Rust core · WebAssembly Loads on first run<br>◇PDF bytes stay in your browser
PDF<br>Drop a PDF here<br>Native-text documents · up to 25 MB<br>Choose PDF
Remove
Select a PDF to begin.
MARKDOWN OUTPUT<br>Copy Markdown
Your parsed Markdown will appear here.
Document type—
Pages—
Processing—
[ 02 / 05 ]Core capabilities
A focused PDF<br>toolchain.
Detection, extraction, layout analysis, and Markdown conversion live in one compact project. The document is parsed once and shared across stages, keeping the pipeline fast and easy to embed.
01detector.rs
Document classification
Identify TextBased, Scanned, ImageBased, or Mixed PDFs, with confidence scores and per-page signals for downstream routing.
02layout.rs
Reading order
Reconstruct multi-column and newspaper layouts from positioned text while preserving logical flow across the page.
03tables/
Table structure
Combine rectangle, line-grid, and alignment heuristics to recover cells, financial tables, and continuations across pages.
04tounicode.rs
Font decoding
Decode CID and Type0 fonts through ToUnicode CMaps, with fallbacks for common embedded font and character encodings.
05markdown/
Semantic Markdown
Emit headings, lists, tables, links, code, emphasis, captions, page markers, and token-efficient cleanup.
06napi/
Packaged for your stack
Install from npm, PyPI, or crates.io. The npm package also includes TypeScript definitions and the bundled pdf-inspector CLI.
[ 03 / 05 ]Architecture
One parse.<br>Clear stages.
The pipeline keeps raw PDF concerns separate from layout and semantic conversion. Each stage has a narrow job, and the modules map directly to the repository structure.
PROCESS_PDF()src/
INPUT<br>PDF bytes<br>Loaded once from path or memory
detector PDF type + confidence
extractor Text, fonts, rects, links
layout Lines, columns, order
tables Rows, columns, cells
markdown/convert.rs<br>Structured output
Clean Markdown plus classification and extraction metadata.
Call processPdf from Node.js, process_pdf from Python or Rust, or run the bundled pdf-inspector CLI. Every interface uses the same Rust pipeline.
[ 04 / 05 ]Benchmark
Measured on<br>real documents.
Evaluated on the opendataloader-bench corpus of 200 PDFs. This comparison covers local engines without model-based PDF parsing, with OCR disabled. Higher scores are better.
200 PDFs · OpenDataLoader benchmarkApple M4 Pro · median of 3 runs
EngineOverallReading orderTablesHeadingsComplete run
pdf-inspector0.8750.9150.8140.7882.8s<br>LiteParse0.8700.9080.6930.81113.9s<br>OpenDataLoader0.8430.9120.4890.7609.8s<br>PyMuPDF4LLM0.7350.8860.4010.42415.5s<br>MarkItDown0.5830.8790.0000.0006.7s
Refreshed July 16, 2026. Scores use the benchmark’s NID, TEDS, and MHS evaluators.
Best fit<br>Native-text PDFs where speed, reading order, and table structure matter. pdf-inspector delivered the highest overall, reading-order, and table scores, along with the fastest complete run in this benchmark. That makes it a strong local default for reports, research papers, financial documents, invoices, and legal PDFs that need clean, structured Markdown without adding OCR latency or infrastructure.
[ 05 / 05 ]Usage
Start with Node.<br>Use the CLI.
Import the native Node.js API in application code or use the bundled pdf-inspector command for scripts and shell pipelines. Python and Rust packages expose the same processing core.
Node.js<br>CLI<br>Python<br>Rust
// npm i @firecrawl/pdf-inspector<br>import { readFileSync } from 'node:fs';<br>import { processPdf } from '@firecrawl/pdf-inspector';
const result = processPdf(<br>readFileSync('document.pdf')<br>);
console.log(result.pdfType);<br>console.log(result.markdown);
// Full Node.js API reference ↗
# run directly from npm<br>npx @firecrawl/pdf-inspector document.pdf
# or install the bundled CLI globally<br>npm install -g @firecrawl/pdf-inspector<br>pdf-inspector document.pdf
# structured pipeline output<br>pdf-inspector document.pdf --json
# classification only<br>pdf-inspector detect document.pdf...