Document to Markdown for RAG: PDF, Word, Excel, PPT, OCR
Pricing
from $0.80 / 1,000 page converteds
Document to Markdown for RAG: PDF, Word, Excel, PPT, OCR
Convert PDF, DOCX, XLSX, PPTX and HTML into clean Markdown with real tables, headings and RAG-ready chunks. Scanned PDF pages are read with OCR in 8 European languages. Nothing is stored.
Pricing
from $0.80 / 1,000 page converteds
Rating
0.0
(0)
Developer
DocFlow Tools
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Features
Share
Document to Markdown for RAG — PDF, Word, Excel, PowerPoint, HTML + OCR
Turn PDF, DOCX, XLSX, PPTX and HTML files into clean Markdown for LLMs, search and RAG pipelines. You get headings, real Markdown tables, paragraphs re-joined across line breaks, and chunks that keep their heading path. Scanned PDF pages are read with OCR (Tesseract) in 8 European languages, only where needed. Each document is downloaded into memory, converted and discarded: the file itself is never saved, only the result in your dataset.
What you get
One dataset item per document URL:
| Field | Description |
|---|---|
url | The document URL you gave |
status | ok, or error if the file could not be downloaded or converted |
error | Reason of the failure (only when status is error) |
type | pdf, docx, xlsx, pptx or html, detected from the file content, not from the URL or extension |
pages | PDF pages converted (always 1 for Word, Excel, PowerPoint and HTML) |
ocrPages | How many of those PDF pages were read with OCR |
metadata | PDF only: Title, Author, Subject, CreationDate, ModDate, Producer (when present) and totalPages |
perPage | Optional (includePerPage): [{page, ocr, markdown}] for each converted PDF page |
markdown | The whole document as Markdown |
markdownKey | Only for very large results (Markdown over 4,000,000 characters): markdown is null and the full text is saved in the run's key-value store under this key (e.g. markdown-1) |
chunks | Optional (includeChunks, on by default): [{index, headings, text, chars}] |
How each format is converted
- PDF: headings detected from font size (lines at least 1.25x the body text size, up to 3 heading levels). Tables with at least two filled columns become Markdown tables. Words are not glued together and hyphenated line breaks are re-joined. Pages with no text layer (fewer than 25 characters) are rendered at 200 DPI and read with OCR.
- Word (DOCX): headings from the
Heading 1-6/Titlestyles, paragraphs with a list style become-items, tables stay in their original position. - Excel (XLSX): one
## Sheet namesection and one Markdown table per non-empty sheet. Cell values are used, not formulas. Up to 5,000 non-empty rows per sheet. - PowerPoint (PPTX): one
## Slide N: Titlesection per slide with bullet points (indented by level), tables and speaker notes as> Notes: .... - HTML: headings, lists, links and emphasis are kept;
script,style,noscriptandtemplateare removed with their content. The whole page is converted (menus and footers included); there is no JavaScript rendering.
How chunks are built
The Markdown is split at every heading. Each chunk carries headings, the path of headings above it joined with
> (for example Methods > Data collection), so the context survives retrieval. A chunk never exceeds
chunkSize characters: long sections are cut at a paragraph break, or at a space if there is none nearby.
Use cases
- Load PDFs, reports, manuals and slide decks into a vector database for RAG.
- Give an AI agent the content of an Office file as Markdown it can read.
- Make scanned PDFs searchable by extracting their text with OCR.
- Turn Excel sheets into Markdown tables that LLMs understand.
- Batch-convert a list of document links into one dataset you can export as JSON, CSV or Excel.
How to use
- Open the Actor in Apify Console and click Try for free (or Start).
- In Document URLs, paste one or more direct links to PDF, DOCX, XLSX, PPTX or HTML files.
- Optionally limit PDF pages (
1-3,7), choose the OCR mode and languages, and the chunk size. - Click Start. When the run finishes, open the Output tab or export the dataset.
Input example (field names exactly as the Actor reads them):
{"documentUrls": ["https://arxiv.org/pdf/1706.03762","https://example.com/files/quarterly-report.docx"],"pages": "1-5","ocrMode": "auto","ocrLanguages": ["eng", "spa"],"includeChunks": true,"chunkSize": 2000,"includePerPage": false}
| Input | Default | Notes |
|---|---|---|
documentUrls | (required) | http or https links, up to 50 MB each |
pages | all pages | PDF only, e.g. 1-3,7. Ignored for other formats |
ocrMode | auto | auto = OCR only pages without text, always = OCR every PDF page, never = no OCR |
ocrLanguages | ["spa", "eng"] | Any of spa, eng, fra, deu, ita, por, cat, nld. Unknown codes are ignored |
includeChunks | true | Return RAG chunks |
chunkSize | 2000 | 200 to 20,000 characters |
includePerPage | false | Also return Markdown per PDF page |
Output example
{"url": "https://example.com/files/annual-report.pdf","status": "ok","type": "pdf","pages": 3,"ocrPages": 1,"metadata": {"Title": "Annual Report 2025","Producer": "LibreOffice 7.6","CreationDate": "D:20260115093000+01'00'","totalPages": 42},"perPage": [],"markdown": "# Annual Report 2025\n\n## Summary\n\nRevenue grew in all regions...\n\n| Region | 2024 | 2025 |\n| --- | --- | --- |\n| North | 1.2 | 1.4 |\n","chunks": [{"index": 1,"headings": "Annual Report 2025 > Summary","text": "## Summary\n\nRevenue grew in all regions...","chars": 1874}]}
A failed document gets a short item like this, and the other documents keep going:
{ "url": "https://example.com/missing.pdf", "status": "error", "error": "download: Client error '404 Not Found' for url ..." }
Pricing
Prices by Apify discount tier: the prices below are for the Bronze tier. Free plan: 50 % off. Silver: 10 % off. Gold and higher: 20 % off. Apify applies the right price automatically.
Pay per event, in USD. Platform compute is included in the event prices.
| Event | Price | When it is charged |
|---|---|---|
| Actor start | $0.00005 | Charged by Apify when a run starts, per GB of run memory (default memory: 2 GB) |
document-processed | $0.003 | Once per document converted successfully |
page-converted | $0.001 | Per PDF page converted from its text layer; one per Word, Excel, PowerPoint or HTML file |
ocr-page | $0.008 | Per PDF page read with OCR (instead of page-converted, not in addition) |
Documents that fail to download or convert are not charged. Events are charged after the result is saved.
Examples:
- One 15-page text PDF (2 GB run, start $0.0001): 0.0001 + 0.003 + 15 x 0.001 = $0.0181
- 10 Word files: 0.0001 + 10 x (0.003 + 0.001) = $0.0401
- One 20-page scanned PDF (
ocrMode: auto): 0.0001 + 0.003 + 20 x 0.008 = $0.1631
With ocrMode: always, every PDF page is charged as ocr-page. You can set a maximum cost per run in Apify; when
it is reached, the Actor stops before the next document.
Use it from code, AI agents and integrations
Apify API (runs the Actor and returns the dataset items in one call):
curl -X POST "https://api.apify.com/v2/acts/docflow-tools~document-to-markdown-rag/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"documentUrls": ["https://arxiv.org/pdf/1706.03762"], "pages": "1-3"}'
Python (pip install apify-client):
from apify_client import ApifyClientclient = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("docflow-tools/document-to-markdown-rag").call(run_input={"documentUrls": ["https://arxiv.org/pdf/1706.03762"], "chunkSize": 1500})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item["status"], item.get("type"), len(item.get("chunks", [])))
AI agents: the Actor can be called by AI agents (Claude, Cursor and other MCP clients) through the Apify MCP server at https://mcp.apify.com.
No-code: connect it to Make, Zapier or n8n through the Apify integrations, or run it on a schedule or webhook.
Limits and notes
- Up to 50 MB per file; only
http://andhttps://URLs; redirects are followed; download timeout 120 s. - Up to 2,000 pages per PDF in one run.
- Supported: PDF, DOCX, XLSX, PPTX, HTML. Not supported: legacy
.doc,.xls,.ppt, RTF, OpenDocument, image files (see Image to Text OCR below), password-protected files. - Documents are processed one after another, in the order given.
- PDF tables drawn only with horizontal rules (common in academic papers) come out as text, not as a table.
- Excel formulas are returned as their last saved value; a file never calculated by Excel may show empty cells.
- OCR runs only on PDF pages, not on pictures embedded in Word or PowerPoint. OCR quality depends on the scan.
- The Actor does not log in to websites and does not render JavaScript: the URL must return the file itself.
FAQ
Does it work with scanned PDFs? Yes. In auto mode each page without a text layer is read with Tesseract OCR
in the languages you choose. Pages with text are not OCR'd, so ocr-page is only charged where it is needed.
Which OCR languages are available? Spanish (spa), English (eng), French (fra), German (deu), Italian
(ita), Portuguese (por), Catalan (cat) and Dutch (nld). Choose only the ones in your documents.
Can I convert only some pages? Yes, with pages (for example 1-3,7). Only those pages are converted and charged.
What happens if one URL fails? You get an item with status: "error" and the reason, it is not charged, and
the remaining documents are processed normally.
Is my document stored? The file is held in memory only while it is converted. What remains is the output you asked for (Markdown, chunks, metadata) in your own Apify dataset.
What if the result is huge? If the Markdown exceeds 4,000,000 characters, it is saved in the run's key-value
store and the dataset item gives its key in markdownKey.
Related tools
- RSS, Atom & JSON Feed Reader — feeds in one format, only new items on scheduled runs.
- Bulk PageSpeed & Core Web Vitals — Google PageSpeed for many URLs with regression alerts.
- Image to Text OCR — text, lines and positions from images.
- Audio Transcriber (Whisper) — audio and video to text and subtitles.
- Merge, Dedupe & Transform Data — merge datasets and files, remove duplicates, export.
- Website Screenshot Monitor — bulk screenshots with change detection.
- Bulk Image Converter & Compressor — convert, compress and resize images.
- Sitemap URL Extractor — every URL of a site from its sitemaps.
- SEO Audit Crawler — on-page SEO score and issues per page.
- Website to Markdown & llms.txt — main content of web pages as Markdown for LLMs.