Convert PDF to Markdown - Free, Local, Tables & Layout Preserved
Turning PDFs into Markdown is the most common document task of the LLM era — RAG knowledge bases, fine-tuning corpora, and migrations into Notion or Obsidian all start with clean structured text. This guide covers three things: which tool to use, what quality actually means, and where the traps are — plus the fastest way to get started.
TL;DR
| Scenario | Recommended approach | Why |
|---|---|---|
| One-off files | Online demo | Runs in your browser, nothing uploaded |
| Batch / scripted jobs | pdf2md CLI or Node.js / Python bindings | One command or a few lines, pipeline-ready |
| Highest conversion quality | pdf-inspector | #1 overall score 0.875, table TEDS 0.814 |
Why pdf-inspector? It's Firecrawl's open-source Rust parser. On the official opendataloader-bench (200 real PDFs) it scores 0.875 overall — first place — while processing the whole corpus in 0.470 seconds, over 30× faster than markitdown. Details on the benchmark page.
Option 1: Online conversion (zero install)
Open the home-page demo and drop in a PDF:
- Fully local: parsing runs inside your browser via WebAssembly; the file never touches a server;
- Free and unlimited: no sign-up, no page-count caps;
- Classify before converting: it tells you whether the PDF is text-based or scanned up front, so you're never confused by garbage output;
- Take results anywhere: copy the Markdown or download it as a
.mdfile.
Note
The browser demo does not include OCR. If your file is scanned, the demo says so explicitly — that's when you need the native packages with OCR (see "What about scanned PDFs?" below).
Option 2: the pdf2md CLI (best for batches)
After installing, convert from the terminal:
cargo install pdf-inspector # ships two CLIs: pdf2md and detect-pdf
pdf2md report.pdf -o report.md # PDF → Markdown
detect-pdf report.pdf # classification only, no body outputCombine with shell loops for bulk conversions, cron jobs, and ETL pipelines. Full flag reference in the CLI guide.
Option 3: code integration (Node.js / Python / Rust)
Node.js
const { processPdf } = require('@firecrawl/pdf-inspector')
const result = await processPdf('report.pdf')
console.log(result.markdown) // clean GitHub-Flavored MarkdownPython
from pdf_inspector import process_pdf
result = process_pdf("report.pdf")
print(result.markdown) # Markdown string, ready to useMore APIs (region extraction, selective OCR, confidence routing) live in the quick-start guide and the API quick reference.
What "conversion quality" actually means
Plenty of tools produce Markdown-looking output; few preserve structure. Four things separate good from bad:
1. Heading levels
Many tools flatten headings into plain paragraphs, which breaks chapter-aware chunking in RAG. pdf-inspector maps font sizes to H1–H4; on the official benchmark markitdown scores 0.000 on headings while pdf-inspector scores 0.788.
2. Table recovery
Financial tables get flattened into scrambled text by weak converters. pdf-inspector combines drawn-rule detection with alignment heuristics to rebuild cell structure as standard Markdown tables, stitching continuations across pages — table TEDS 0.814, best in class.
3. Reading order
Reading a two-column paper top-to-bottom interleaves the columns. Layout analysis reconstructs true reading order (0.915 on the benchmark); RTL text is supported too.
4. Garbled glyphs and exotic fonts
Design-exported PDFs often embed CID/Type0 fonts that weaker tools render as boxes or hex soup. pdf-inspector decodes them through ToUnicode CMaps (CJK included); pages it genuinely can't decode are flagged instead of silently returning wrong text.
What about scanned PDFs?
About 54% of PDFs are native text and can be extracted fast and free; the rest are scans or image-based and need OCR. The right architecture is classify first, then route:
- Check the type with detect-pdf or the online demo (~10–50ms);
- TextBased → convert locally at zero OCR cost;
- Scanned / Mixed → send only the necessary pages to OCR (the native packages ship selective OCR, tagging every page native / ocr / fused).
See Is my PDF text-based or scanned? for the details.
FAQ
Can I feed the output straight into RAG?
Yes. Output is standard GitHub-Flavored Markdown with heading levels, lists, tables, and page markers — token-efficient, and the page markers give you citation-level provenance back to specific pages.Is there a free PDF-to-Markdown converter?
Yes — the online parser on this site is free with no sign-up and no page limits, and your file never leaves the device. The library itself is MIT-licensed and free for commercial use.How does it compare to markitdown?
Same benchmark: overall 0.875 vs 0.589, speed 0.470s vs 16.165s, headings 0.788 vs 0.000. Full breakdown in the markitdown vs pdf-inspector comparison.Does it handle encrypted PDFs?
Password-protected PDFs cannot be parsed directly — remove protection first. Error codes and recovery advice for damaged files are in the troubleshooting guide.Next steps
- Try it online: drop in a PDF and see the verdict plus Markdown instantly;
- Install: npm / PyPI / crates.io — five ways in;
- Getting started: your first conversion in ten minutes.