Document → Markdown

PDF, DOCX, XLSX, CSV, ODT and images in — Markdown out.

POST /api/v1/document-to-markdown MCP document_to_markdown convertAI

Free for PDF/Office/CSV/HTML. Image input spends Workers AI neurons.

Playground

Base64-encoded file bytes (data: URLs are accepted too).
Fetch the document from this URL.
Original filename — the extension drives format detection. Strongly recommended.
Runs against this deployment's live API.

Result

Fill in the form and hit Run.

Call it from code

How it works

Wraps Cloudflare's AI.toMarkdown() document converter.

Supported: PDF, DOCX, XLSX / XLS / XLSM / XLSB, ODT / ODS, Numbers, CSV, HTML, XML, and images (PNG / JPEG / WebP / SVG / GIF / BMP).

Everything except images is converted with deterministic parsers and costs no AI quota. Image input runs object detection plus summarisation models, which does spend neurons — for scanned text prefer describe-image with task: "ocr".

Upload a file from the playground, or pass url / fileBase64 over the API.

Parameters

ParameterTypeDefaultDescription
url string Fetch the document from this URL.
fileBase64 string Base64-encoded file bytes (data: URLs are accepted too).
filename string Original filename — the extension drives format detection. Strongly recommended.

Response

Markdown plus the detected MIME type and a token estimate.

ParameterTypeDefaultDescription
markdown string Converted content.
name string Document name.
mimetype string Detected MIME type.
tokens integer Cloudflare's token estimate for the output.
format string markdown or text.

Pairs well with