Document to Markdown & RAG Chunks (PDF, DOCX, OCR) avatar

Document to Markdown & RAG Chunks (PDF, DOCX, OCR)

Pricing

Pay per event

Go to Apify Store
Document to Markdown & RAG Chunks (PDF, DOCX, OCR)

Document to Markdown & RAG Chunks (PDF, DOCX, OCR)

Convert PDF, DOCX, PPTX, XLSX, EPUB, HTML, CSV and TXT into clean Markdown plus optional token-sized chunks with page numbers for RAG and LLM pipelines. Optional OCR for scanned PDFs. Processes only files you supply.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Nick Hellmich

Nick Hellmich

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

Share

Document to Markdown & RAG Chunks (PDF, DOCX, PPTX, XLSX, HTML, EPUB)

Convert PDFs, Word, PowerPoint, Excel, HTML, EPUB, CSV and text files into clean Markdown, with optional token-sized chunks for RAG / LLM pipelines and OCR for scanned pages. Upload files or paste links, including Google Docs/Sheets/Slides, Google Drive, Dropbox and GitHub links, which are converted automatically.

Quick start

  1. Click Start. The prefilled input converts the IRS W-9 form (a 6-page PDF) so you can see real output in about 10 seconds for $0.012.
  2. Replace it with your own files: upload, or paste public links.
  3. Open the Output tab. There's one row per document with the Markdown, the page count, token count and chunks.

What you get

FieldDescription
markdownClean Markdown with headings, lists, tables, and <!-- page N --> markers for PDFs
chunksWhen chunkSize > 0: token-sized chunks with pageStart/pageEnd and token counts
pageCount, tokenCount, detectedFormat, metadataUseful for budgeting embeddings
charged, note, errorcharged: false rows cost nothing; error says what to do

Sample row (trimmed):

{ "source": "https://www.irs.gov/pub/irs-pdf/fw9.pdf", "ok": true, "detectedFormat": "pdf", "pageCount": 6,
"tokenCount": 7412, "chunkCount": 15, "charged": true,
"markdown": "<!-- page 1 -->\nForm W-9 (Rev. March 2024) Request for Taxpayer Identification Number and Certification ...",
"chunks": [{ "index": 0, "text": "Form W-9 ...", "tokens": 512, "pageStart": 1, "pageEnd": 1 }] }

Input tips

  • Links that work: direct file links plus share links from Google Docs/Sheets/Slides (exported as DOCX/XLSX/PPTX), Google Drive files, Dropbox and GitHub file pages. The file must be shared as "Anyone with the link". Private links return a clear, uncharged error.
  • RAG chunks: set chunkSize (for example 512) and chunkOverlap (for example 64). The tokenizer is cl100k_base (OpenAI) or o200k_base.
  • Scanned PDFs: turn on OCR and pick the language (OCR pages are billed separately).

Pricing (pay per event)

EventPrice
Document processed (includes the first 5 pages)$0.01
Extra page beyond 5$0.002
OCR page$0.01

Examples: a 2-page DOCX costs $0.01; a 15-page PDF costs $0.03; a 50-page report costs $0.10. Failed documents are never charged, and that includes dead links, sign-in pages and unsupported files. Bronze, Silver and Gold Apify plans get 10/20/30% off. You can cap any run with Maximum cost per run.

Limits

Up to 50 documents per run, 50 MB per file and 200 pages per document by default (500 max, set with maxPages). The output stays in your run's dataset under Apify's normal retention. Documents are processed in memory and never logged.

FAQ

Does it work with Google Docs? Yes. Paste the normal share link; the document must be shared with "Anyone with the link". Why did I get "LOGIN_OR_VIEWER_PAGE"? The link pointed at a sign-in or viewer page, not the file. Make it public or paste a direct download link. You weren't charged. Tables? DOCX, XLSX, PPTX and HTML tables become Markdown tables. PDF tables come out as text in reading order. Images or charts? Their text is extracted only via OCR; images themselves aren't described. Can an AI agent call it? Yes, through the Apify API or MCP server, and it supports x402 payments. See the API tab for ready-to-paste code.

Integrations: no-code and AI

Zapier: new Google Drive file → Markdown chunks → your RAG knowledge base

  1. Trigger: Google Drive → New File in Folder. Share the folder as "Anyone with the link" (or use a direct download link).
  2. Action: Apify → Run Actor → Document to Markdown & RAG Chunks, with run synchronously turned on (small files finish in about 10 s). Input: {"fileUrls": ["{{Alternate Link}}"], "chunkSize": 512, "chunkOverlap": 64}.
  3. Search: Apify → Fetch dataset items using the run's defaultDatasetId.
  4. Action: send chunks[].text to your vector store (Pinecone, Qdrant or Supabase via Webhooks by Zapier), or save markdown to Notion or Google Docs.

Make: email attachments → Markdown in Google Sheets

Gmail Watch Emails → Apify Run an Actor (run synchronously: Yes) → Apify Get Dataset Items (Dataset ID = defaultDatasetId) → Google Sheets Bulk Add Rows (source, pageCount, tokenCount, markdown).

n8n: nightly re-index of a docs folder

Install the Apify node (@apify/n8n-nodes-apify, or search "Apify" on n8n Cloud) → Schedule Trigger → Apify: Run an Actor and get dataset → Split Out chunks → Embeddings + Vector Store nodes. In an AI Agent node, add the Apify Tool so the agent can convert a file the user pastes into chat.

LangChain (Python): load documents straight into a vector index

from langchain_apify import ApifyWrapper
from langchain_core.documents import Document
docs = ApifyWrapper().call_actor(
actor_id="steady_kahikatea/document-to-markdown",
run_input={"fileUrls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"], "chunkSize": 512},
dataset_mapping_function=lambda item: Document(page_content=item.get("markdown") or "",
metadata={"source": item["source"], "pages": item.get("pageCount")}),
).load()

For an agent, use ApifyActorsTool("steady_kahikatea/document-to-markdown").

LlamaIndex: one Document per chunk, with page numbers

from llama_index.core import Document
from llama_index.readers.apify import ApifyActor
items = ApifyActor("<APIFY_TOKEN>").load_data(
actor_id="steady_kahikatea/document-to-markdown",
run_input={"fileUrls": ["https://example.com/handbook.pdf"], "chunkSize": 512},
dataset_mapping_function=lambda it: Document(text=it.get("markdown") or "", metadata={"source": it["source"]}))

Sample input → output: {"fileUrls": ["https://example.com/handbook.pdf"], "chunkSize": 512} → {"ok": true, "pageCount": 12, "tokenCount": 6120, "chunks": [{"index": 0, "text": "# Employee Handbook ...", "tokens": 512, "pageStart": 1, "pageEnd": 2}], "charged": true}. Cost: $0.024.

Tip: Zapier's synchronous Run Actor times out after 30 seconds. For anything longer, run it asynchronously and start a second Zap from the Finished Actor run trigger. Make's synchronous timeout depends on your plan; use Watch Actor Runs for long jobs.

Also works with: the Apify API ("API" tab), the Apify MCP server for Claude/Cursor-style agents, and x402 payments.

Docs used: Zapier · Make · n8n · LangChain · LlamaIndex

For AI agents

Actor: steady_kahikatea/document-to-markdown
Input: {"fileUrls": ["https://example.com/file.pdf"], "chunkSize": 512}
Output: one dataset row per document: markdown, chunks[], pageCount, tokenCount, charged, error

Need the reverse? Markdown & HTML to PDF / DOCX Generator (steady_kahikatea/markdown-html-to-pdf-docx).

Feedback or a file that converts badly? Open an issue on the Issues tab. If this Actor saves you time, a rating helps others find it.