Best PDF to Markdown Converters: A Reproducible Test of OCR & Parsing Accuracy
We tested 6 PDF-to-Markdown converters on real-world documents: scanned pages, tables, code blocks, and multi-column layouts. See which tool preserved structure best.
If you work with LLMs, RAG pipelines, or static site generators, you know the bottleneck: getting clean Markdown out of PDFs. Raw text extraction loses tables; OCR hallucinates characters on faded scans; and every parser handles code blocks differently.
We ran a reproducible benchmark of six PDF-to-Markdown converters against four distinct document types: a scanned academic paper, a financial table, a software documentation page, and a multi-column newsletter. Here is what we found.
Why Markdown Matters for Modern Workflows
Markdown has become the lingua franca for AI training data, documentation, and static sites. Unlike plain text, it preserves headings, lists, code fences, and inline formatting. Unlike HTML, it is human-readable and LLM-friendly. A good PDF to Markdown converter should output something you can paste directly into a ChatGPT prompt or a GitHub README without cleanup.
The Contenders
We selected six tools that cover different approaches:
| Tool | Approach | Pricing | Open Source |
|---|---|---|---|
| marker-pdf | ML-based layout detection + OCR fallback | Free | Yes |
| Unstructured.io (partition-pdf) | Model-based chunking with table extraction | Free tier + paid plans | Yes |
| LlamaParse | Proprietary LLM-powered parsing | Free tier (1k pages/day) | No |
| pdftotext + smash | Classic pdftotext + regex-to-MD heuristic | Free | Yes |
| Adobe Extract API | Adobe Sensei ML | Paid (PDF Services) | No |
| gettxt.ai | Vision model + structure-aware parsing | Free tier + pro | No |
Methodology
Each tool processed the same four PDFs. We evaluated output on five criteria:
- Heading preservation — Are H1/H2/H3 retained as
#,##,###? - Table fidelity — Are rows and columns preserved as Markdown tables?
- Code block handling — Are code snippets inside backtick fences, with language tags?
- Image and caption extraction — Are figures and captions referenced?
- OCR accuracy — On scanned (non-digital) pages, are words correct?
Score range: 0–10 per criterion, averaged across all four documents.
Test Documents
We used publicly available PDFs from arXiv (scanned paper), the US SEC (financial filing table), Python.org documentation (code blocks), and a public-domain newsletter (multi-column).
Note: All test files and scoring scripts are available on GitHub for full reproducibility.
Results
Overall Accuracy Scores
| Tool | Headings | Tables | Code Blocks | Images/Captions | OCR (Scanned) | Average |
|---|---|---|---|---|---|---|
| gettxt.ai | 9.5 | 9.0 | 9.5 | 8.5 | 9.0 | 9.1 |
| marker-pdf | 9.0 | 8.0 | 8.5 | 7.5 | 9.5 | 8.5 |
| Unstructured.io | 9.0 | 8.5 | 8.0 | 7.0 | 7.5 | 8.0 |
| LlamaParse | 8.0 | 7.0 | 9.0 | 6.5 | 8.5 | 7.8 |
| Adobe Extract API | 7.5 | 9.5 | 5.0 | 8.0 | 6.0 | 7.6 |
| pdftotext + smash | 6.0 | 4.0 | 7.0 | 3.0 | 5.0 | 5.0 |
Highlights per Tool
marker-pdf excelled on scanned documents with its Surya OCR backend — it produced clean output on the arXiv paper. However, it struggled with deeply nested tables, occasionally flattening sub-rows.
Unstructured.io handled table structures well, especially with the hi_res strategy enabled. Its main weakness was multi-column layouts, where it sometimes mixed text from different columns together.
LlamaParse stood out on code-heavy documents, correctly identifying language tags for Python, JavaScript, and YAML code blocks. It faltered on image-heavy pages where it skipped embedded figures entirely.
Adobe Extract API produced the most faithful table representation — it is the only tool that preserved merged cells. But it relies on the PDF having embedded text; scanned pages without hidden text layers returned garbled output.
pdftotext + smash is the lightweight option: fast, no API key needed, and works well for simple text-only PDFs. As soon as tables or images appeared, structure collapsed.
gettxt.ai scored 9.1/10 overall thanks to its vision-based approach that treats each page as both image and text stream, cross-referencing the two for higher accuracy.
When to Use Which Tool
Your choice depends on your specific document types:
Scanned Documents (Receipts, Contracts, Old Books)
Use marker-pdf or gettxt.ai. Both have strong OCR backends. marker-pdf is free and runs locally; gettxt.ai requires no local setup.
Financial Reports and Tables
Use Adobe Extract API if you have a budget and need perfect table fidelity. Use gettxt.ai or Unstructured.io if you need a good balance of accuracy and cost.
Code Documentation and Technical Manuals
Use LlamaParse or gettxt.ai. Both handle syntax highlighting and code fence detection reliably.
Quick One-Off Conversions
Use gettxt.ai's PDF to Text API or the PDF to Markdown API for a no-setup pipeline that works in seconds.
The Hidden Costs of Free Converters
Free open-source tools like marker-pdf and pdftotext have genuine advantages: no API key, no data leaving your machine, full customisation. But they come with trade-offs:
- Setup time — Installing PyTorch dependencies for marker-pdf can take 30+ minutes.
- GPU requirement — Marker-pdf runs roughly 5 seconds per page on a GPU, 30+ seconds on CPU.
- No SLA — If a batch job fails at page 400 of 500, there is no support.
- Maintenance — PDF parsing libraries change; your pipeline breaks on updates.
For a large-scale RAG pipeline or production ingestion, a managed API often costs less than the engineering time spent maintaining an open-source stack.
How to Build a PDF-to-Markdown Pipeline
If you are integrating PDF-to-Markdown into an application, the typical pipeline looks like this:
- Upload — Accept PDF via API or web form.
- Detect type — Is it scanned or digital? Check for embedded text layer.
- Route — Scanned → OCR engine; digital → direct text extraction.
- Parse — Split into sections (headings, tables, code blocks, figures).
- Serialize — Emit as Markdown with YAML front matter.
- Validate — Run a schema check: all required fields present? Tables well-formed?
For a ready-made solution, see the Text Extraction API or the AI Document Extraction endpoint.
FAQ
How did the different tools perform on accuracy in your benchmark?
In our benchmark, gettxt.ai scored 9.1/10 overall, marker-pdf scored 9.5/10 on OCR for scanned documents, and Adobe Extract API scored 9.5/10 on table fidelity. Accuracy depends heavily on document type — test with your own files before selecting a tool.
Can I convert scanned PDFs to Markdown?
Yes. Tools with OCR backends (marker-pdf, gettxt.ai, LlamaParse) can convert scanned PDFs. Without OCR, a scanned page produces empty output. See our guide on how to convert a scanned PDF to text for a detailed walkthrough.
Which tools handle tables well in your tests?
Adobe Extract API scored 9.5/10 on table fidelity in our benchmark. Among free tools, Unstructured.io scored 8.5/10 on table fidelity. Both preserved row and column structure reliably.
How does PDF to Markdown compare with PDF to Text?
Markdown preserves structure (headings, lists, tables) while plain text discards it. If you are feeding output into an LLM for summarisation or Q&A, Markdown generally yields better results because the model can interpret document hierarchy. See PDF to Text vs PDF to Markdown: Which Output Is Better for AI Workflows for a direct comparison.
Do I need an API key to convert PDFs?
Open-source tools (marker-pdf, pdftotext) do not require a key but need local setup. Cloud APIs like gettxt.ai, LlamaParse, and Adobe Extract require an API key. gettxt.ai offers a free tier with no credit card required.
Summary
No single PDF-to-Markdown converter fits every use case. Choose based on your document type:
- Scanned docs → marker-pdf (local) or gettxt.ai (API)
- Complex tables → Adobe Extract (paid) or Unstructured.io (free tier)
- Code documentation → LlamaParse or gettxt.ai
- Production pipeline at scale → gettxt.ai offers a solid balance of accuracy, speed, and reliability
Try it yourself: upload a PDF to the PDF to Markdown page or hit the PDF to Markdown API directly with your own documents.