PDF to Markdown API

One POST turns a PDF — or a scan — into clean Markdown with headings, lists and tables intact. Built for RAG and LLM pipelines.

Markdown is the format LLMs read best: lightweight, structure-preserving, and trivially chunkable. But most "PDF to Markdown" tools hand you a flat text dump with the headings and tables flattened out. PDFjet reconstructs the actual document structure and returns clean Markdown you can embed straight into a RAG pipeline.

It's one call, no SDK required. Scanned pages are OCR'd automatically, so image-only PDFs come through as real Markdown text rather than blanks — and your files are processed in memory and never stored.

Convert a PDF to Markdown

curl -X POST https://pdfjet.dev/extract/md \
  -H "Authorization: Bearer pj_live_..." \
  -F [email protected]
Get your free API key → 100 pages/month free, no credit card.

Structure preserved, not flattened

Headings become Markdown headings, lists become lists, and tables become Markdown tables — the hierarchy your model relies on to reason. That structure is also what makes the output easy to chunk on heading boundaries for retrieval.

Scanned PDFs work too

If the PDF is image-only, PDFjet detects that, runs OCR, and returns the same clean Markdown. No separate OCR step, no gaps where the text should be.

Go straight from Markdown to chunks

When you're feeding a vector store, skip the manual splitting: /extract/chunks returns heading-aware, token-bounded chunks (set ?max_tokens and ?overlap), each with a heading breadcrumb, page numbers and a bounding box for citations.

curl -X POST 'https://pdfjet.dev/extract/chunks?max_tokens=512' \
  -H "Authorization: Bearer pj_live_..." \
  -F [email protected]

Why PDFjet

Comparing PDF-to-Markdown options? See the head-to-heads:

See all comparisons →

FAQ

How do I convert a PDF to Markdown with an API?

POST the PDF as the file field to https://pdfjet.dev/extract/md with your Bearer API key. You get clean Markdown back — headings, lists and tables preserved. Scanned PDFs are OCR'd automatically.

Does it handle scanned PDFs?

Yes. PDFjet detects image-only pages, runs OCR, and returns the same clean Markdown, so scans aren't a dead end.

Is the Markdown ready for RAG?

Yes — the structure is preserved so it chunks cleanly, and /extract/chunks will do heading-aware, token-bounded chunking with page and bounding-box provenance for you.

Are my files stored?

No. Files are processed in memory and deleted immediately — never stored, never used to train models.

Turn your PDFs into clean data in minutes

100 pages/month free. Every feature. Zero data retention. No credit card.

Get your free API key →

Related

Guides