Document to Markdown (PDF, Office, OCR) for AI agents
Pricing
from $4.00 / 1,000 document converteds
Document to Markdown (PDF, Office, OCR) for AI agents
Turn PDF, Word, PowerPoint, Excel, CSV, HTML, EPUB, image, legacy DOC/PPT, RTF and OpenDocument links into clean Markdown for LLMs and RAG: tables, headings, metadata, per-page text, OCR and ready-made chunks. Priced per document plus per OCR page; failed files are free.
Pricing
from $4.00 / 1,000 document converteds
Rating
0.0
(0)
Developer
Sapphire Studio
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
8 days ago
Last modified
Categories
Features
Share
What does Document to Markdown do?
Document to Markdown turns links to documents into clean, LLM-ready Markdown. Give it a list of URLs to PDF, Word (DOCX and legacy DOC), PowerPoint (PPTX and legacy PPT), Excel (XLSX, XLS, ODS), OpenDocument (ODT, ODP), RTF, CSV, HTML, EPUB, Markdown, text, JSON or image files, and you get one dataset row per document with:
- the whole document as Markdown: headings, paragraphs, bullet and numbered lists, links and tables as GFM Markdown tables;
- title, author, language, creation and modification dates, page count, word count, token estimate and table count;
- optional per-page Markdown (PDF pages, slides, sheets or EPUB chapters);
- optional RAG chunks split at headings and paragraphs, each with its heading, character range and page range;
- OCR (Tesseract) for scanned PDF pages and images, used only on pages that have no text layer unless you ask for more.
It is built for AI agents whose fetch tool hits a PDF, RAG and search pipelines that need clean text with tables intact, legal, research and procurement teams turning filings, papers and tenders into text, and anyone chaining it after a crawler that collects file links.
Why use it?
- One tool for every common format. PDFs with multi-column layouts, Word reports, slide decks with speaker notes and chart data, spreadsheets with several sheets, e-books and web pages all come out in the same Markdown shape. Old
.docand.pptfiles from document archives, RTF exports and OpenDocument files from LibreOffice work too. - Tables survive. PDF tables are rebuilt from text positions, Word, PowerPoint and HTML tables are converted cell by cell, and every sheet of a workbook becomes a table.
- Clean text. Running headers, footers and page numbers are removed, two- and three-column pages are read column by column, and words hyphenated across lines are joined.
- Fair price. One price per converted document, plus a small per-page price only for pages that really needed OCR. Failed, blocked and skipped documents are free.
- No proxy costs. Files are downloaded directly, with Apify Proxy only as a fallback for downloads that fail; no residential proxy traffic is used.
How to use it
- Paste one or more document URLs into Document URLs. Google Drive, Google Docs, Dropbox and GitHub share links are turned into direct downloads automatically. Files you upload to an Apify key-value store work too (use the record URL).
- Choose the OCR mode and languages if your files contain scans or images.
- Turn on Split into chunks for RAG and Include per-page Markdown if you need them.
- Run the Actor and read the dataset, or call it from your agent through the Apify API or the Apify MCP server.
Example input
{"urls": ["https://arxiv.org/pdf/1706.03762","https://raw.githubusercontent.com/microsoft/markitdown/main/packages/markitdown/tests/test_files/test.docx"],"ocr": "auto","chunking": true,"chunkSize": 800}
Input
| Field | Type | Default | Description |
|---|---|---|---|
urls | list of URLs | required | Documents to convert, up to 1000 per run. |
ocr | auto, always, off | auto | Automatic OCRs scanned PDF pages and images only. Always OCRs every PDF page. Off never OCRs. |
ocrLanguages | list | ["eng"] | English, German, French, Spanish, Italian, Portuguese, Dutch. |
outputPages | boolean | false | Add the Markdown of every page, slide, sheet or chapter. |
chunking | boolean | false | Add RAG chunks. |
chunkSize | integer | 800 | Target chunk size in tokens (100 to 8000). |
chunkOverlap | integer | 80 | Tokens repeated between chunks (at most half the chunk size). |
maxPagesPerDocument | integer | 300 | Pages, slides, sheets or chapters converted per document. |
maxOcrPagesPerDocument | integer | 10 | Scanned pages OCRed (and charged as ocr_page) per document. |
maxFileSizeMb | integer | 50 | Larger files are skipped as invalid_input. |
maxConcurrency | integer | 3 | Documents processed in parallel (Advanced). |
debug | boolean | false | Save a diagnostic record per document to the key-value store (Advanced). |
Output
One row per input URL, always with the same keys in the same order. This is a real row from a live run, with the long text fields shortened for this page:
{"url": "https://nvlpubs.nist.gov/nistpubs/CSWP/NIST.CSWP.29.pdf","final_url": "https://nvlpubs.nist.gov/nistpubs/CSWP/NIST.CSWP.29.pdf","file_name": "NIST.CSWP.29.pdf","status": "ok","ok": true,"error": null,"format": "pdf","content_type": "application/pdf","file_size_bytes": 1518858,"title": "The NIST Cybersecurity Framework (CSF) 2.0","author": "National Institute of Standards and Technology","language": "EN-US","created_at": "2024-03-06T20:46:45.000Z","modified_at": "2025-06-04T14:58:23.000Z","page_count": 32,"pages_converted": 32,"ocr_pages": 0,"extraction": "text","table_count": 7,"word_count": 8923,"char_count": 66784,"token_estimate": 16696,"markdown": "# The NIST Cybersecurity Framework (CSF) 2.0\n\nNational Institute of Standards and Technology\n\nThis publication is available free of charge from: https://doi.org/10.6028/NIST.CSWP.29\n\nFebruary 26, 2024\n\nAbstract\n\nThe NIST Cybersecurity Framework (CSF) 2.0 provides guidance to industry, government agencies, and other organizations to manage cybersecurity risks. ...","markdown_truncated": false,"full_markdown_url": null,"pages": [{ "page": 1, "markdown": "# The NIST Cybersecurity Framework (CSF) 2.0\n\nNational Institute of Standards and Technology\n\nThis p ...", "char_count": 200, "ocr": false }],"chunks": [{ "index": 1, "text": "cyberframework@nist.gov.\n\nTable of Contents\n\n1. Cybersecurity Framework (CSF) Overview ....", "heading": "The NIST Cybersecurity Framework (CSF) 2.0", "char_start": 3105, "char_end": 6086, "page_start": 4, "page_end": 5, "token_estimate": 825 }],"metadata": {"subject": "The NIST Cybersecurity Framework (CSF) 2.0 provides guidance to industry, government agencies, and other organizations to manage cybersecurity risks. ...","keywords": "cybersecurity; Cybersecurity Framework (CSF); cybersecurity risk governance; cybersecurity risk management; enterprise risk management; Profiles; Tiers","creator": "Acrobat PDFMaker 23 for Word","producer": "Adobe PDF Library 23.8.53","pdf_version": "1.6","encrypted": false,"has_forms": false},"warnings": null,"checked_at": "2026-10-27T00:13:10.252Z","attempts": 1,"fetch_mode": "direct"}
A failed row from the same run (this site answers automated downloads with a bot-protection challenge, which the Actor never tries to solve; the row is not charged):
{"url": "https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32016R0679","final_url": null,"status": "blocked","ok": false,"error": "HTTP 202: the site answered with a bot-protection challenge.","format": null,"markdown": null,"checked_at": "2026-10-27T00:14:04.657Z","attempts": 3,"fetch_mode": null}
(The failed row has every other key too, set to null.) The run also writes a SUMMARY record to the key-value store with counts by status, formats, pages and OCR pages converted, charged document and ocr_page events, LibreOffice conversions and their average time, download sizes and the run duration.
Legacy and OpenDocument formats
.doc, .ppt, .rtf, .odt and .odp files are converted with LibreOffice (headless) and then read like DOCX and PPTX, so they get the same headings, lists, tables, links and footnotes, and presentations get one page per slide. Their rows carry extraction: "libreoffice" and metadata.converted_with and metadata.conversion_ms. This is a real .doc row from a live run (Markdown shortened):
{"url": "https://raw.githubusercontent.com/apache/tika/main/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/test/resources/test-documents/testWORD.doc","final_url": "https://raw.githubusercontent.com/apache/tika/main/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/test/resources/test-documents/testWORD.doc","file_name": "testWORD.doc","status": "ok","ok": true,"error": null,"format": "doc","content_type": "application/octet-stream","file_size_bytes": 32768,"title": "Sample Word Document","author": "User A","language": null,"created_at": "2010-11-12T16:22:00.000Z","modified_at": "2010-11-12T16:22:00.000Z","page_count": null,"pages_converted": null,"ocr_pages": 0,"extraction": "libreoffice","table_count": 1,"word_count": 109,"char_count": 750,"token_estimate": 188,"markdown": "# Sample Word Document Title\n\n## And now for a subtitle\n\n# Main Heading\n\n# Heading Level 1\n\n## Heading Level 2\n\n### Heading Level 3\n\nThis is a sample Microsoft Word Document.\n\nThis document includes text that is **BOLD** and _ITALIC_.\n\n| This is a table | |\n| --- | --- |\n| | Nested tableMore of our nested table |\n| The table h ...","markdown_truncated": false,"full_markdown_url": null,"pages": null,"chunks": null,"metadata": {"subject": null,"keywords": null,"description": null,"language": "en-US","application": null,"word_count_reported": null,"converted_with": "LibreOffice 25.2.3.2","conversion_ms": 952},"warnings": null,"checked_at": "2026-10-27T03:46:20.602Z","attempts": 1,"fetch_mode": "direct"}
One real ok row per new format from the same run (20 of 20 legacy files ok):
| Format | File | Title | Pages | Words | Tables | Conversion ms | Markdown starts with |
|---|---|---|---|---|---|---|---|
doc | testWORD_various.doc | 127 | 1 | 283 | Footnote appears here[1] Here is a text box Bold italic underline superscript subscript italic italic underline Here is a list: - ... | ||
ppt | testPPT_various.ppt | Slide 1 | 1 | 121 | 1 | 253 | ## Slide 1 | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | --- | --- | --- | | Row 2 Col 1 | Row 2 Col 2 | Row 2 Col 3 | Here is a text box Footnote ... |
rtf | testRTFVarious.rtf | 124 | 1 | 269 | Footnote appears here[1] Here is a text box Bold italic underline superscript subscript Here is a list: - Bullet 1 - Bullet 2 - Bullet 3 ... | ||
odt | testODFwithOOo3.odt | Apache Tika | 2 | 61 | 0 | 405 | # Apache Tika Test Document This is a rather[1] difficult test document, with interesting features. A rectangle Another interesting project is So ... |
odp | LibreOfficeImpress_odp_1.3.odp | Beehive | 2 | 10 | 0 | 429 | ## Slide 1: This is An example Impress file ## Slide 2 ... |
Status values
| Status | Meaning | Charged |
|---|---|---|
ok | Downloaded and converted. | Yes |
not_found | HTTP 404 or 410, unknown host, or no text in the file (for example a scan with OCR off). | No |
blocked | The site refused the download (HTTP 401, 403, 429) or answered with a bot-protection page. | No |
invalid_input | Bad URL, private address, file too large, unsupported or damaged format, password-protected file. | No |
timeout | The run time limit was reached before this document. | No |
charge_limit_reached | Your maximum charge per run was reached. | No |
error | Server errors or network failures after retries, or an unexpected error. | No |
Supported formats
| Format | format value | How it is read | extraction |
|---|---|---|---|
pdf | Text layer with layout analysis; OCR for scanned pages | text, ocr or mixed | |
| Word | docx | Native (headings, lists, tables, links, footnotes) | text |
| PowerPoint | pptx | Native (slides, tables, chart data, image alt text, speaker notes) | text |
| Excel, OpenDocument spreadsheet, CSV | xlsx, xls, ods, csv, tsv | Every sheet as a table | text |
| EPUB | epub | One page per chapter | text |
| HTML | html | Main content only (page menus and footers removed) | text |
| Markdown, text, JSON, XML | markdown, text, json, xml | As is (JSON and XML as code blocks) | text |
| Images | png, jpeg, tiff, bmp, gif, webp | OCR | ocr |
| Legacy Word | doc | LibreOffice, then the Word reader | libreoffice |
| Legacy PowerPoint | ppt | LibreOffice, then the PowerPoint reader (one page per slide) | libreoffice |
| RTF | rtf | LibreOffice, then the Word reader | libreoffice |
| OpenDocument text | odt | LibreOffice, then the Word reader | libreoffice |
| OpenDocument presentation | odp | LibreOffice, then the PowerPoint reader (one page per slide) | libreoffice |
| Apple Pages, Keynote, Numbers; ZIP | (not converted) | Reported as invalid_input with a hint to export as PDF, DOCX, PPTX or XLSX |
Pricing
Pay per event, only for rows with status: "ok":
| Event | When | Price |
|---|---|---|
document | Once per successfully converted document, any format and any length. | USD 0.004 |
ocr_page | Once per page or image whose text came from OCR (the row's ocr_pages), on top of document. | USD 0.002 |
Pages that have a text layer are never OCRed with OCR set to Automatic, so ordinary PDFs, Office files and web pages cost one document event and nothing else. A 20-page scanned PDF costs one document plus up to 10 ocr_page events at the default maxOcrPagesPerDocument of 10. Rows with any other status are free, and OCR on a document that ends up failing is free too.
Set a maximum charge per run in the run options. Before every OCR page the Actor checks that the remaining budget can still pay for it; pages it cannot pay for are not OCRed (the row says so in warnings), and once the next document no longer fits the Actor stops starting new ones and lists the rest as charge_limit_reached. Use maxPagesPerDocument and maxOcrPagesPerDocument to bound what you get, and pay, per document.
Limitations
- Measured on the Apify platform (2 GB memory): 29 documents from 15 sites, 348 pages including 7 OCR pages, converted in 66 seconds with 28 of 29 ok (96.6%). The only failure was a site that serves a bot-protection challenge.
- Native PDF text converts at well under a second per page; OCR takes several seconds per page (about 10 to 18 seconds per page at the default 2 GB memory). Give the run more memory (and therefore more CPU) for large scanned files.
- PDF table detection works on tables whose columns are separated by white space. Tables drawn as images, charts, and cells that sit at different heights in one row may come out as text or split rows. Formulas are kept as plain text.
- Legacy
.doc,.ppt,.rtf,.odtand.odpfiles: 20 of 20 public test files from two open-source test corpora converted on the platform, about 0.2 to 0.5 seconds of LibreOffice time per file after the first (about 1 second while LibreOffice starts). One conversion runs at a time, so a run with many legacy files converts them one after the other while other formats continue in parallel. Page counts are not reported for.docand.rtf(LibreOffice does not lay out pages in headless mode). Embedded images, drawings and OLE objects are dropped, as for DOCX. - Text drawn in custom font encodings (some chart labels) can come out garbled; use OCR set to Always for such files.
- Documents behind a login, a paywall or a bot challenge cannot be read.
- One dataset item can hold about 8 MB. Larger outputs keep the first 1,000,000 characters in the row and store the full Markdown in the key-value store (
full_markdown_url).
FAQ
Can my agent call it directly?
Yes. It accepts a plain array of URLs, returns one flat row per document and is a normal pay-per-event Actor, so agents can run it through the Apify API, the Apify MCP server or any agent framework with Apify tools.
Are my documents stored?
The Markdown is stored only in your run's dataset and key-value store, under your account's data retention settings. The original files are processed in memory and in temporary files that are deleted right after conversion.
Which pages get OCR?
With OCR set to Automatic, only PDF pages without usable text that contain an image, plus image files. Set it to Always for PDFs whose text layer is broken.
What does OCR cost?
One ocr_page event per page that was actually OCRed, in addition to the document event. With OCR set to Automatic that is only scanned pages and images. Set OCR to Off to never pay for OCR, or lower maxOcrPagesPerDocument.
Can it read old .doc and .ppt files?
Yes. Legacy Word and PowerPoint files, RTF and OpenDocument text and presentations are converted with LibreOffice and come out in the same Markdown shape as DOCX and PPTX. Password-protected and damaged files are reported as invalid_input and not charged.
Does it crawl websites?
No. It converts exactly the URLs you give it. To convert every PDF on a site, collect the links with a crawler first and pass them in.
Legal disclaimer
This Actor is not affiliated with, endorsed by or sponsored by any website or file host it downloads from. All trademarks belong to their owners. It reads only publicly available files at URLs that you supply; it uses no login, solves no CAPTCHA or bot challenge, and adds no personal data. You are responsible for having the right to process the documents you submit.
Support
Open an issue on the Actor's Issues tab with the run ID and the input that did not work. Built and maintained by Sapphire Studio.