PDF-to-Markdown API for AI pipelines and RAG

Convert PDFs, scans, and Office files into clean Markdown, with headings, tables, lists, and code blocks intact. Built for RAG pipelines, search indexes, and knowledge bases, and free to try with 5,000 credits each month.


Try it live

See the Markdown output on a sample document

Pick a sample document and inspect the result as rendered Markdown, raw Markdown, or spatial JSON. To run it on a different PDF, open Parse Studio, which needs no signup. The playground processes the first 10 pages by default.

One call, one Markdown string

Post a PDF and read the whole document back from a single field. Headings, tables, lists, and code blocks survive the trip, ready to chunk and embed.

Pay for the depth you need

Text mode reads born-digital PDFs for 1 credit per page. Step up to an OCR mode only for the scans and complex layouts that need it.

OCR for scanned pages

Structure, understand, and agentic modes run OCR on image-based pages in more than 100 languages, detected automatically or set per request. Text mode has no OCR.

Used by Lufthansa, Disney, Autodesk, UBS, Dropbox, IBM
Lufthansa
Disney
Autodesk
UBS
Dropbox
IBM

Three steps

How to convert PDF to Markdown

Every conversion is a single call to the Data Extraction API parse endpoint.

Get an API key

Create a free account for a key and 5,000 credits each month.


Post the PDF to the parse endpoint

Send the file with instructions naming a parsing mode and Markdown as the output format.


Read output.markdown

The response is JSON. The whole document comes back as a Markdown string in the output.markdown field.

Try it out

This example converts an uploaded PDF file to Markdown with the Data Extraction API.


  1. Save a PDF as document.pdf and run the sample from the same folder. The Markdown comes back in output.markdown; the JavaScript, Java, C#, and PHP samples write it to result.md. The Python sample prints it, and the shell samples print the full JSON response.
  2. The samples use text mode, which reads born-digital PDFs only and has no OCR. For scanned PDFs or images, change the mode to structure.
curl -X POST https://api.nutrient.io/extraction/parse \
-H "Authorization: Bearer your_api_key_goes_here" \
-F "file=@document.pdf" \
-F 'instructions={"mode":"text","output":{"format":"markdown"}}'

Example output

What the API returns

The Markdown is returned in output.markdown as a single string, ready to write straight to an .md file. It preserves document structure, including headings, paragraphs, and tables; understand mode also keeps lists.

Response
{
"status": 200,
"requestId": "GN3CqZ2L3ed9lXYAA2QB",
"output": {
"markdown": "# Quarterly report\n\n\nRevenue grew 15% year over year, led by the cloud business.\n\n\n## Highlights\n\n\n312 new customers\r\nChurn down to 2.1%\n\n\n## Revenue by region\n\n\n<table>\n <tr>\n <th>Region</th>\n <td>Q2</td>\n <td>Q3</td>\n </tr>\n <tr>\n <th>Europe</th>\n <td>4.2M</td>\n <td>4.9M</td>\n </tr>\n <tr>\n <th>North America</th>\n <td>6.1M</td>\n <td>6.8M</td>\n </tr>\n</table>"
},
"metrics": {
"pagesProcessed": 1,
"processingTimeMs": 263
},
"usage": {
"data_extraction_credits": {
"cost": 1.0
}
},
"configuration": {
"apiVersion": "2026-05-25",
"engine": {},
"mode": "text",
"outputFormat": "markdown"
}
}

Parsing modes

Four parsing modes

Pick the depth of analysis the document needs. Credit cost rises with depth.

Text

The cheapest route, and enough when the PDF already carries a clean text layer.

PDF to Markdown RAG Search

Structure

Adds OCR, plus element bounds, confidence scores, and page context in spatial output. Suited to straightforward scans.

Scans Bounds Confidence

Understand

AI augmentation on top of OCR for forms, tables, multicolumn layouts, printed handwriting, and formulas.

Forms Tables Formulas

Agentic

Visual reasoning for the hardest files, such as degraded scans and cursive handwriting.

Cursive handwriting Degraded scans


Security is our top priority

SOC 2 Type 2 audited

Nutrient’s infrastructure is SOC 2 Type 2 audited and GDPR compliant. See our privacy policy and security documentation for details on data handling.

HTTPS encryption

All communication between your application and Nutrient is done via HTTPS to ensure your data is encrypted when it’s sent to us.

Safe payment processing

All payments are handled by Paddle. Nutrient DWS Processor API never has direct access to any of your payment data.


Frequently asked questions

What is a PDF-to-Markdown API?

Nutrient’s PDF-to-Markdown API converts PDF documents into Markdown with a single API call. It’s part of the Data Extraction API, which returns the whole document as Markdown for large language model (LLM) pipelines, RAG, search indexing, and knowledge bases, without building a PDF parsing layer.

How do I convert a PDF to Markdown programmatically?

Nutrient converts a PDF in one request: Post the file to the Data Extraction API parse endpoint with instructions naming a mode and Markdown output. Then read the result from output.markdown in the JSON response. This page has samples in shell, Windows shell, Python, JavaScript, Java, C#, and PHP. For a walkthrough, read how to convert PDF to Markdown in Python, or the Java PDF-to-Markdown guide for the SDK route.

Is PDF to MD the same as PDF to Markdown?

Yes, Nutrient’s PDF-to-Markdown API is a PDF-to-MD API: MD is the file extension for Markdown. The converted document comes back as a Markdown string, normally written to a file ending in .md.

Does it keep tables and headings?

Yes, Nutrient’s Markdown output preserves headings, paragraphs, lists, tables, and code blocks. Tables come back as HTML tables inside the Markdown.

Does it work on scanned PDFs?

Yes, Nutrient’s Data Extraction API runs OCR on scanned and image-based pages in structure, understand, or agentic mode (text mode has no OCR), with support for more than 100 languages. OCR detects the language automatically, or you can set it with the options.language parameter. See the supported languages guide for the full list.

Why convert PDFs to Markdown for AI workflows?

Nutrient converts PDFs to Markdown because LLMs and search indexes handle lightweight, text-first Markdown better than PDF images or complex layouts. Clean Markdown goes straight into AI pipelines, RAG systems, and knowledge bases.

Is there a free PDF-to-Markdown API?

Yes, Nutrient’s Data Extraction API free plan includes 5,000 credits each month, with no credit card required. See Data Extraction API pricing for credit costs per mode and paid plans.

Is there a local CLI or skill for Claude Code and Codex?

Yes, Nutrient’s PDF-to-Markdown skill runs locally in Claude Code and Codex, and documents aren’t uploaded to Nutrient. The PDF-to-Markdown CLI does the same from a terminal or CI. This cloud API is best for server-side RAG pipelines and high-volume processing.

Ready to try it?

Create an account to get your DWS Processor API key and start making API calls.