> For the complete documentation index, see [llms.txt](https://guide.docmaker.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.docmaker.co/features/extract-documents-to-markdown.md).

# Extract documents to Markdown

Turn an existing document into clean, structured Markdown — no template needed. Send a `file_url` and docMaker downloads it, auto-detects its format, and parses it into Markdown you can feed into an LLM, a search index, or your own pipeline.

### Supported formats

| Format                      | How it's parsed                                            |
| --------------------------- | ---------------------------------------------------------- |
| DOCX, PPTX                  | Docling                                                    |
| PDF (digital / text-based)  | Docling                                                    |
| PDF (scanned / image-based) | Mistral OCR (auto-detected, or force with `parsingEngine`) |
| JPEG, PNG, TIFF, WebP       | Mistral OCR                                                |
| `.eml`                      | Mail parser (headers + body)                               |
| Markdown, plain text        | Passed through unchanged                                   |
| HTML                        | Stripped to text                                           |

PDF digital-vs-scanned detection is automatic. If auto-routing sends a scanned PDF to Mistral OCR and that call fails, it automatically falls back to Docling with OCR rather than failing the job.

### Fast path for PDFs

Set `fast_pdf_extraction: true` to skip Docling/Mistral OCR entirely and read the PDF's embedded text layer directly — much faster and cheaper, but returns little or no text for a genuinely scanned PDF (no text layer to read). Optionally set `pages` (e.g. `"1-3,5"`) to extract only specific pages. Mutually exclusive with `parsingEngine`.

### Async, with a longer timeline than other routes

Like every docMaker document route, this returns `202` with a `jobId` immediately. Poll `GET /jobs/{jobId}` until `status` is `processed`, or set a `webhook_url` to get the result automatically.

Unlike this API's other routes (typically done in well under a minute), parsing a large, multi-page, or scanned document can legitimately take several minutes end-to-end. `status: "created"` for a few minutes on this route is expected — poll for up to \~10 minutes before treating it as a real problem, or just use `webhook_url` to avoid polling.

### Pricing

Unlike docMaker's other routes, this isn't a fixed cost per call — it depends on the parser actually used and the page count, known only after parsing:

| Parser                         | Cost                 |
| ------------------------------ | -------------------- |
| Docling                        | 1 credit / 50 pages  |
| Mistral OCR                    | 1 credit / 10 pages  |
| `fast_pdf_extraction`          | 1 credit / 200 pages |
| Email / Markdown / text / HTML | 1 credit flat        |

Always at least 1 credit.

Click "Next" to see the full list of `documents/extract` API parameters.
