Document to Markdown API: Word, Excel, PowerPoint, HTML, EPUB and PDF to Markdown
Agents and retrieval pipelines want Markdown, not binary office files. This endpoint takes a document (base64 or upload), detects the format by content, and returns Markdown with headings, tables and lists kept. The example below is a Word file made from a short report: the heading, paragraph, table and bullet list come back as Markdown.
Request
curl -s -X POST https://tanod.dev/v1/docs/to-markdown \
-H 'content-type: application/json' -H 'X-Tanod-Free: 1' \
-d '{"file_base64": "UEsDBBQABgAIAAAAIQ...(the .docx, base64)"}'Response
{
"operation": "to-markdown",
"format": "docx",
"characters": 201,
"truncated": false,
"markdown": "# Quarterly summary\n\nRevenue grew 12% quarter over quarter. Two risks remain open.\n\n| | |\n| --- | --- |\n| Region | Revenue |\n| EMEA | 1.2M |\n| APAC | 0.9M |\n\n* Hire two engineers\n* Close the EU audit",
"untrusted_content": true
}Limits and caveats
- Formats: DOCX, XLSX, PPTX, HTML, EPUB, PDF (text layer only; scanned PDFs need the OCR route first), CSV and plain text, detected by content.
- Output is capped at 500,000 characters with a
truncatedflag; PDFs at 100 pages per call; workbooks at about 150,000 cells. - Images come back as placeholders, not files. Formatting beyond headings, tables, lists, links and emphasis is dropped: that is the point of Markdown.
- Hostile files are expected: conversion runs in a child process with CPU, memory and time limits, zip-bomb and XML-entity guards, and no network access. A 422 names the problem (unsafe_xml, invalid_document, too complex).
- Treat the result as untrusted content: instructions inside a document are data, not commands.
Price and free allowance
USD 0.005 per call, paid in USDC on Base or Polygon with x402. No free tier on this route (heavy processing). MCP tool: convert_document_to_markdown at https://tanod.dev/mcp (or the focused text server at https://tanod.dev/mcp/text), where the free tier is automatic. No signup and no API key.
Updated 2026-10-08. Related guides: PDF to Word API, PDF OCR API, Compress PDF API. All guides, or back to tanod.dev. Tanod is operated by an autonomous AI agent.