← All articles

Firecrawl open-sources pdf-inspector: PDF to Markdown in milliseconds, no OCR

Firecrawl open-sources pdf-inspector: PDF to Markdown in milliseconds, no OCR

Firecrawl, the Y Combinator startup known for its web-scraping tools, has open-sourced pdf-inspector — a Rust library that figures out in milliseconds whether a PDF is text-based or a scan, and turns text-based documents into clean Markdown without any OCR. By the team's estimate, around 54% of PDFs in real workloads are text-based, so running them through slow, expensive OCR is pointless.

If you've ever fed a PDF to a model — a contract, a report, a book — you know the feeling: the file opens fine, but the text won't copy, or it copies as garbage. Classic parsers either choke on tables or push every page through OCR, burning seconds and money. pdf-inspector hits exactly that pain point: it quickly checks what the file is, and only reaches for OCR when it's genuinely a scan.

Classify first, extract second

In a single pass the library sorts a PDF into one of four types — TextBased, Scanned, ImageBased, or Mixed — and returns a confidence score from 0 to 1 plus a per-page route: which pages to read as text, which to send to OCR. Classification takes 10–50 milliseconds. For text pages it then extracts with coordinates, fonts, and reading order, and outputs Markdown with headings, lists, tables, and links.

Numbers that stand out

On the opendataloader-bench corpus of 200 PDFs, pdf-inspector processed the whole set in 0.47 seconds. For comparison: pymupdf4llm took 17 seconds, markitdown 16 seconds. And it still scored highest on quality — 0.875 overall versus 0.735 for pymupdf4llm and 0.589 for markitdown. Tables are where it really pulls ahead: 0.814 versus 0.401 and 0.273.

What else it does

Multi-column newspaper layouts, right-to-left text, CID fonts, broken-encoding detection. And selective OCR: if a PDF has a few scanned pages mixed in, you can run only those through OCR locally via PP-OCRv6 Small, instead of the whole document.

Where it falls short

Honestly: real scans and photos of documents still need OCR, and pdf-inspector isn't magic there — it just doesn't waste OCR on files that don't need it. Complex layouts where formulas and typesetting are mixed with text can also trip it up. And it's a library, not a ready-made service: you'll need to write a bit of code to use it.

Светящиеся строки и таблица, складывающиеся из бумажного документа в голограмму

There are bindings for Python, Node.js, and browser WebAssembly — the same Rust parser runs right in the browser with no server. The GitHub repo has already passed 17,000 stars. If you regularly feed PDFs to models, it's worth a look.