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.

By gettxt.aiPublished Updated

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:

ToolApproachPricingOpen Source
marker-pdfML-based layout detection + OCR fallbackFreeYes
Unstructured.io (partition-pdf)Model-based chunking with table extractionFree tier + paid plansYes
LlamaParseProprietary LLM-powered parsingFree tier (1k pages/day)No
pdftotext + smashClassic pdftotext + regex-to-MD heuristicFreeYes
Adobe Extract APIAdobe Sensei MLPaid (PDF Services)No
gettxt.aiVision model + structure-aware parsingFree tier + proNo

Methodology

Each tool processed the same four PDFs. We evaluated output on five criteria:

  1. Heading preservation — Are H1/H2/H3 retained as #, ##, ###?
  2. Table fidelity — Are rows and columns preserved as Markdown tables?
  3. Code block handling — Are code snippets inside backtick fences, with language tags?
  4. Image and caption extraction — Are figures and captions referenced?
  5. 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

ToolHeadingsTablesCode BlocksImages/CaptionsOCR (Scanned)Average
gettxt.ai9.59.09.58.59.09.1
marker-pdf9.08.08.57.59.58.5
Unstructured.io9.08.58.07.07.58.0
LlamaParse8.07.09.06.58.57.8
Adobe Extract API7.59.55.08.06.07.6
pdftotext + smash6.04.07.03.05.05.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:

  1. Setup time — Installing PyTorch dependencies for marker-pdf can take 30+ minutes.
  2. GPU requirement — Marker-pdf runs roughly 5 seconds per page on a GPU, 30+ seconds on CPU.
  3. No SLA — If a batch job fails at page 400 of 500, there is no support.
  4. 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:

  1. Upload — Accept PDF via API or web form.
  2. Detect type — Is it scanned or digital? Check for embedded text layer.
  3. Route — Scanned → OCR engine; digital → direct text extraction.
  4. Parse — Split into sections (headings, tables, code blocks, figures).
  5. Serialize — Emit as Markdown with YAML front matter.
  6. 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.

Related guides