Kanto Labs
Document to Markdown icon

Documents · Apify actor

Turn PDFs and office files into LLM-ready Markdown

Give it links to PDF, Word, PowerPoint, Excel, EPUB or HTML files. Get back clean Markdown, page counts, metadata and ready-to-embed chunks for your LLM, vector database or RAG pipeline.

$0.004 per documentFailed inputs are free

What it does

Document to Markdown, in short

  • One actor for PDF, DOCX, PPTX, XLSX, XLS, EPUB, HTML, CSV, JSON, XML, IPYNB, MSG, TXT and ZIP
  • Headings stay headings, tables become Markdown tables, PDF pages are marked <!-- Page N --> so answers can cite a page
  • Page or slide count, word and character counts, file name, format, size and a SHA-256 hash
  • Optional heading-aware RAG chunks of the size you choose, each with its headingPath
  • Detects the real file type from the bytes, so links without an extension work
  • Optional downloadable .md file per document

Who it's for

Built for

RAG and AI agent buildersTurn reports, manuals, papers and policies into chunks for Pinecone, Qdrant, Weaviate, pgvector or Chroma.
Knowledge-base teamsConvert a folder of mixed office files into one searchable Markdown corpus.
ResearchersBatch-extract text from arXiv papers and other academic PDFs.
Data engineersReplace a PDF tool, a Word tool and an Excel tool with one step, and use sha256 to detect when a document really changed.

Example

Input and output

One dataset row per result, downloadable as JSON, CSV or Excel, or read through the Apify API.

Input
{
  "documentUrls": ["https://arxiv.org/pdf/1706.03762"],
  "chunkSize": 1500,
  "chunkOverlap": 150
}

From a real cloud run on the 15-page “Attention Is All You Need” paper (converted in 277 ms), shortened.

Output (one row)
{
  "url": "https://arxiv.org/pdf/1706.03762",
  "fileName": "1706.03762v7.pdf",
  "format": "PDF",
  "fileSizeBytes": 2215244,
  "pageCount": 15,
  "wordCount": 6177,
  "markdown": "<!-- Page 1 -->\nProvided proper attribution is provided, ...\nAttention Is All You Need ...",
  "chunks": [
    { "index": 0, "text": "<!-- Page 1 -->\nProvided proper attribution ...",
      "headingPath": [], "charCount": 1475 }
  ],
  "processingTimeMs": 277,
  "error": null
}

Pricing

Pay per result. Failures are free.

$0.004document converted · $4.00 per 1,000

No subscription, no monthly minimum. Apify platform compute is included in the price; Apify also adds a tiny start fee per run ($0.00005 per GB of run memory).

Example costs
You runYou pay
1 document$0.004
50 PDFs$0.20
1,000 documents$4.00
20,000 documents$80.00
Worked example. You convert an 800-file knowledge base and 30 of the files are image-only scans.770 converted × $0.004 = $3.08
30 scans = $0.00

Not charged:

  • Downloads that fail
  • Files over the size limit and unsupported types
  • Scanned PDFs with no text layer, conversion errors and timeouts

The price is the same for a 1-page memo and a 300-page manual. You can set Maximum cost per run in the run options and the actor stops cleanly when it is reached.

FAQ

Questions

Does it do OCR on scanned PDFs?

No. Digitally created PDFs have a text layer and work. A pure image scan is returned with an error and is not charged. For scans, use Image to Text OCR.

Do I pay for files that fail?

No. Only documents that produced Markdown are charged. Every failure is listed with its reason.

How are PDFs handled?

With PDFium (the PDF engine inside Chrome, via pypdfium2), which keeps word spacing intact and marks each page. Other formats use Microsoft's open-source MarkItDown converter.

Do links without a file extension work?

Yes. The type is detected from the downloaded bytes, and servers that send the wrong Content-Type are handled.

Is my data stored?

Only in your own Apify run storage (dataset and key-value store), which you control and can delete.

Try Document to Markdown on Apify

Apify's free plan includes monthly platform credit you can use to try it. Also callable from AI assistants through the Kanto Labs MCP server.

Run it on Apify