PDF to Markdown: PDF & DOCX Document to Markdown for LLM & RAG
Pricing
from $0.80 / 1,000 documents
PDF to Markdown: PDF & DOCX Document to Markdown for LLM & RAG
Convert PDF, DOCX, HTML and text documents to clean Markdown for LLMs and RAG: headings, lists, de-hyphenated text, removed headers/footers, per-page output and token-sized chunks. Bulk PDF to Markdown and PDF to text from URLs.
Pricing
from $0.80 / 1,000 documents
Rating
0.0
(0)
Developer
Emilio Cisneros
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Share
Convert PDF, Word (DOCX), HTML and text files to clean Markdown for LLMs, RAG pipelines, search indexes and data extraction. Paste URLs (Google Drive, Google Docs, Dropbox and GitHub share links work) and get structured output.
- Markdown with structure: headings detected from font sizes and bold lines, bullet and numbered lists, paragraphs re-flowed, words de-hyphenated across line breaks.
- Clean text: repeated headers, footers and page numbers are removed automatically.
- RAG-ready chunks (optional): split on headings and paragraphs, with the heading path ("Chapter 2 > Results"), source page numbers, token estimates and overlap.
- Per-page Markdown (optional) for page-level citations.
- Metadata: title, author, subject, keywords, creator/producer, created and modified dates, page count, PDF version, encryption, word count and token estimate.
- Scanned-PDF detection:
needsOcrandscannedPagestell you which pages have no text layer, instead of returning silent empty output. - Page ranges (
1-5,8,10-), password-protected PDFs, up to 100 MB per file, and bulk lists.
Text-layer extraction only (no OCR), so it's fast and cheap: a 15-page paper converts in about 0.5 s.
How to use
- Paste public URLs of PDF, DOCX, HTML or text files into URLs.
- Optionally turn on Chunking to get RAG-ready chunks with token counts, or set a page range.
- Click Start and get clean Markdown (headings, lists, tables) per document.
Why this Actor
| This Actor | Typical PDF extractors | |
|---|---|---|
| Output | Structured Markdown + chunks + per-page | Raw text blob |
| Headers/footers/page numbers | Removed | Mixed into the text |
| RAG chunks with heading path + pages | Yes | Rarely |
| DOCX / HTML / Google Docs | Yes | PDF only |
| Price for a 10-page PDF | $0.005 | $0.01 to $0.03 |
Input
{ "urls": ["https://arxiv.org/pdf/1706.03762", "https://drive.google.com/file/d/FILE_ID/view"], "chunking": true, "chunkTokens": 800, "includePages": false }
Output
{ "url": "https://arxiv.org/pdf/1706.03762", "fileType": "pdf", "title": "Attention Is All You Need", "totalPages": 15, "pagesProcessed": 15, "wordCount": 6067, "tokensEstimate": 10400,"metadata": { "author": null, "created": "2024-04-10T21:11:43Z", "producer": "pdfTeX-1.40.25" }, "needsOcr": false,"markdown": "## Attention Is All You Need\n\nAshish Vaswani...\n\nThe dominant sequence transduction models...","chunks": [ { "index": 0, "text": "...", "headingPath": "Attention Is All You Need > 1 Introduction", "pages": [1, 2], "tokens": 790 } ] }
Pricing (pay per event)
- $0.001 per document plus $0.0004 per page (DOCX/HTML/TXT: 1 page per ~500 words).
- So a 10-page PDF costs $0.005 and 1,000 ten-page PDFs cost $5.
- Failed downloads and unsupported files are free error records. Use Max pages per document and the run's max cost to cap spend.
How much does it cost?
You only pay for results, never for compute time:
| You get | You pay (Starter/Bronze plan price) |
|---|---|
| 100 10-page documents | $0.50 |
| 1,000 10-page documents | $5.00 |
| 10,000 10-page documents | $50.00 |
Apify's free plan includes $5 of usage every month, and free-plan users pay half price on this Actor, so that covers about 2,000 10-page documents at no cost. Paid plans get volume discounts (Silver -10%, Gold -20%). Set a maximum cost per run and the Actor stops cleanly at your limit.
Tips
- For scanned PDFs (
needsOcr: true), run them through an OCR tool first. - Files behind a login can't be fetched. Upload them to a public location or an Apify key-value store and pass the record URL.
Run it from code (API, Python, JavaScript)
curl -X POST "https://api.apify.com/v2/acts/api-co~pdf-to-markdown/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \-H "Content-Type: application/json" -d '{"urls": ["https://arxiv.org/pdf/1706.03762"]}'
from apify_client import ApifyClientclient = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("api-co/pdf-to-markdown").call(run_input={"urls": ["https://arxiv.org/pdf/1706.03762"]})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item)
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });const run = await client.actor('api-co/pdf-to-markdown').call({"urls": ["https://arxiv.org/pdf/1706.03762"]});const { items } = await client.dataset(run.defaultDatasetId).listItems();
It also works from AI agents through the Apify MCP server, and with Zapier, Make, n8n, Google Sheets and webhooks. You can schedule it in the Apify Console.
FAQ
Does it do OCR on scanned PDFs?
No. It extracts the text layer of digital PDFs, which covers most reports, papers and invoices generated by software. Scanned or image-only pages are flagged in the output (needsOcr, scannedPages) so you know which files need an OCR step.
What formats are supported? PDF, DOCX, HTML and plain text, from any public URL, including Google Drive and Dropbox share links.
Is the output good for RAG? Yes. You get Markdown with headings and lists preserved, headers and footers removed, de-hyphenated text, per-page output and ready-made chunks with their heading path and page number.
How much does it cost? About $0.005 for a 10-page PDF. You pay per document and per page converted.
Use cases
- RAG and AI agents: convert manuals, papers and reports into Markdown chunks for a vector database.
- Document pipelines: bulk-convert PDFs to text for search, classification or summarization.
- Research: extract the text of academic papers and reports.
- LLM fine-tuning datasets: clean text with page counts and metadata.