PDF to Markdown & Text Extractor for LLM & RAG
Pricing
from $1.50 / 1,000 documents converted
PDF to Markdown & Text Extractor for LLM & RAG
PDF to Markdown and text extractor for AI agents and RAG. Converts PDF, Word, Excel, PowerPoint, CSV and scanned images (optional OCR) from a URL or Base64 into clean Markdown, tables as JSON and RAG-ready chunks with page numbers. Works with Claude, Cursor, n8n and Apify MCP. Pay per document.
Pricing
from $1.50 / 1,000 documents converted
Rating
0.0
(0)
Developer
mcpkit
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
18 hours ago
Last modified
Categories
Features
Share
What is PDF to Markdown & Text Extractor
PDF to Markdown & Text Extractor converts PDF, DOCX, XLSX, PPTX, CSV and TXT documents, and with optional OCR also scanned PDFs and images, into clean Markdown or plain text for LLMs, AI agents and RAG pipelines. Pass a document URL or a Base64 file and get back one dataset item per document with:
- Markdown with headings, paragraphs, lists and tables in reading order.
- Tables as Markdown and as JSON rows (PDF ruled tables, Word tables, every Excel sheet, PowerPoint tables).
- Chunks of about N characters with overlap and page numbers, ready for a vector store.
- Metadata: title, author, creation date, language, page count.
It runs without a browser, so a typical 15-page PDF is converted in about one second. OCR is off by default and runs only on pages without a text layer. The file type is detected from the file content, not the extension. Repeated page headers and page numbers are removed. You pay per converted document; failed documents are not charged.
What can you convert
- PDF to Markdown and plain text, with headings and reading order preserved.
- PDF table extractor: PDF tables to JSON rows and Markdown tables.
- Word to Markdown: DOCX headings, lists, bold, italic, links and tables.
- Excel to JSON and Markdown: XLSX and CSV, every sheet as a table.
- PowerPoint to Markdown: PPTX slides, tables and speaker notes.
- PDF to RAG chunks with page numbers, ready for a vector store.
- Image to text (OCR): scanned PDFs and PNG, JPEG, TIFF or WEBP images in 14 languages, with
"ocr": true.
How to use
Apify Console
- Open the Actor and paste one or more public document URLs into Document URLs.
- Optionally set Chunk size (for example
2000) and Page range (for example1-5). - Click Start. Each document appears as one row in the dataset; open the Content view to read the Markdown.
API
curl -X POST "https://api.apify.com/v2/acts/mcpkit~pdf-to-markdown/run-sync-get-dataset-items?token=<APIFY_TOKEN>" \-H "Content-Type: application/json" \-d '{"urls": ["https://arxiv.org/pdf/1706.03762"], "chunkSize": 2000}'
Apify MCP for Claude and Cursor
Add the Actor to your MCP client configuration:
{"mcpServers": {"apify": {"url": "https://mcp.apify.com/?tools=mcpkit/pdf-to-markdown","headers": { "Authorization": "Bearer <APIFY_TOKEN>" }}}}
Then ask: "Convert https://arxiv.org/pdf/1706.03762 to Markdown and summarize Table 2." The agent calls the tool with {"urls": ["https://arxiv.org/pdf/1706.03762"]}. AI agents should pass documents as URLs; Base64 input is meant for n8n, Make and API pipelines where the file is already in memory.
n8n HTTP Request node
- Method
POST, URLhttps://api.apify.com/v2/acts/mcpkit~pdf-to-markdown/run-sync-get-dataset-items, query parametertoken= your Apify API token. - JSON body with a URL from a previous node:
{ "urls": ["{{ $json.fileUrl }}"], "chunkSize": 1500, "chunkOverlap": 150 }
- Or with a binary file from a previous node (up to 6.5 MB):
{ "files": [{ "fileName": "{{ $binary.data.fileName }}", "base64": "{{ $binary.data.data }}" }] }
Feed markdown or chunks[].text into your LLM or vector store node. Make works the same way with the HTTP "Make a request" module.
Input
| Field | Type | Default | Description |
|---|---|---|---|
urls | array of strings | — | Public URLs of documents (PDF, DOCX, XLSX, PPTX, CSV, TXT). Required unless files is provided. |
files | array of {fileName, base64} | [] | Documents as Base64 or Data URI (data:application/pdf;base64,...), max 6.5 MB per decoded file, the whole input must stay under 9 MB. Required unless urls is provided. |
outputFormat | markdown | text | markdown | Markdown keeps headings, lists and tables; text returns plain text. |
includeTables | boolean | true | Extract tables as Markdown and as JSON rows. |
pageRange | string | "" | Pages for PDF and PPTX, e.g. 1-5,8 or 10-. Empty = all pages. |
chunkSize | integer | 0 | Chunk size in characters for RAG, e.g. 2000. 0 = no chunking. |
chunkOverlap | integer | 200 | Overlap between chunks in characters, capped at half of chunkSize. |
maxPages | integer | 300 | Safety limit of pages per document. Pages over the limit are skipped and not charged. |
ocr | boolean | false | Run OCR on scanned PDF pages without a text layer and on PNG, JPEG, TIFF and WEBP images. Charged per OCR page. |
ocrLanguages | array | ["eng"] | OCR languages: eng, deu, fra, spa, ita, por, nld, pol, rus, ukr, tur, ces, chi_sim, jpn. Fewer languages is faster. |
{"urls": ["https://arxiv.org/pdf/1706.03762", "https://docs.sheetjs.com/pres.xlsx"],"files": [],"outputFormat": "markdown","includeTables": true,"chunkSize": 2000,"chunkOverlap": 200}
Output
One dataset item per document. Every field is always present (null or [] when there is no data).
{"sourceType": "url","url": "https://arxiv.org/pdf/1706.03762","fileName": "1706.03762v7.pdf","success": true,"fileType": "pdf","title": "Attention Is All You Need","pageCount": 15,"pagesProcessed": 15,"markdown": "# Attention Is All You Need\n\n## Abstract\n\nThe dominant sequence transduction models ...","tables": [{"page": 8,"sheet": null,"markdown": "| Model | BLEU EN-DE | EN-FR | Training Cost (FLOPs) EN-DE | EN-FR |\n|---|---|---|---|---|\n...","rows": [["Model", "BLEU EN-DE", "EN-FR", "Training Cost (FLOPs) EN-DE", "EN-FR"], ["GNMT + RL [38]", "24.6", "39.92", "2.3 · 10^19", "1.4 · 10^20"]]}],"chunks": [{ "index": 0, "text": "# Attention Is All You Need ...", "pageStart": 1, "pageEnd": 2 }],"metadata": { "author": null, "createdAt": "2024-04-10T21:11:43Z", "language": null },"charCount": 40868,"needsOcr": false,"ocrPages": 0,"fullTextUrl": null,"fullResultUrl": null,"error": null}
sourceTypeisurl,upload(a public Apify key-value store record URL) orbase64; for Base64 inputurlisnull.tables[].pageis the page number for PDF and PPTX;tables[].sheetis the worksheet name for XLSX.chunks[].pageStartandpageEndlet you cite the page of every chunk.ocrPagesis the number of pages or images converted with OCR;needsOcr: truemeans some pages had no text layer andocrwas off.- A failed document has
success: falseand a readableerror, for exampleURL returned an HTML page instead of a document. - If the Markdown is larger than 5 MB, the full text is saved to the run's key-value store (
fullTextUrl) andmarkdownholds the first 100,000 characters.
How much does it cost to convert PDF to Markdown?
The Actor uses pay-per-event pricing. You pay only for documents that were converted successfully.
| Event | Free | Bronze | Silver | Gold+ |
|---|---|---|---|---|
| Actor start (per run) | $0.00005 | $0.00005 | $0.00005 | $0.00005 |
| Document converted (first 20 pages included) | $0.003 | $0.0025 | $0.002 | $0.0015 |
| Extra page (each page over 20) | $0.0001 | $0.00008 | $0.00006 | $0.00005 |
| OCR page (each scanned page or image processed with OCR) | $0.002 | $0.0018 | $0.0015 | $0.0012 |
A page for non-PDF documents: DOCX and TXT — every 3,000 characters, XLSX and CSV — every 100 rows, PPTX — one slide.
Examples on the Free plan, all documents in one run:
- 100 documents of 10 pages: $0.00005 + 100 × $0.003 ≈ $0.30.
- 1,000 documents of 10 pages: $0.00005 + 1,000 × $0.003 ≈ $3.00.
- 1,000 documents of 100 pages: $0.00005 + 1,000 × ($0.003 + 80 × $0.0001) ≈ $11.00.
- 100 scanned documents of 5 pages with OCR: $0.00005 + 100 × ($0.003 + 5 × $0.002) ≈ $1.30. OCR pages are not counted as extra pages.
Failed downloads, HTML pages, scans when OCR is off, password-protected and corrupted files are not charged. Pages with a text layer are never charged as OCR pages. The run stops cleanly when your maximum charge per run is reached.
FAQ
Does it support scanned PDFs and OCR?
Yes, with "ocr": true. OCR (Tesseract) runs only on PDF pages without a text layer and on PNG, JPEG, TIFF and WEBP images; pages with text use the fast text path. Set ocrLanguages for non-English documents, for example ["deu"]. Each OCR page is charged with the ocr-page event, and runs with OCR get more memory automatically. With ocr off (the default), a scan is returned with needsOcr: true and success: false, and it is not charged. OCR output is plain paragraphs: tables on scanned pages are returned as text.
What are the file size limits?
Up to 50 MB per document from a URL and up to 6.5 MB per decoded Base64 file. The Apify API limits the whole run input to 9 MB, and Base64 adds about a third to the size, so all Base64 files in one run must total less than about 6.5 MB. Use URL input for larger files. maxPages (default 300) limits pages per document.
Can it open password-protected files?
No. Password-protected PDFs and Office files, and URLs that require a login, return an error and are not charged.
How well are complex tables extracted?
PDF tables drawn with ruling lines, as in most reports and scientific papers, are detected, including tables with horizontal rules only and multi-level headers. Merged cells are placed in the leftmost column they span. Tables laid out with whitespace only are returned as text. Word, Excel and PowerPoint tables are always extracted exactly.
Which formats are supported?
PDF, DOCX, XLSX (all sheets), PPTX (slides, tables and speaker notes), CSV and TXT/Markdown, plus PNG, JPEG, TIFF and WEBP images with OCR. Legacy .doc, .xls, .ppt and OpenDocument files are not supported; save them as DOCX, XLSX, PPTX or PDF.
Can I convert thousands of documents?
Yes. Pass all URLs in one urls array: one run processes them five at a time and is charged one start fee. For example, 1,000 documents of 10 pages in a single run cost about $3.00 on the Free plan. For recurring jobs, call the Actor from Make or n8n, or use Apify Schedules.
Is my data sent to an AI model or a third party?
No. The Actor does not call any external API or AI model. It downloads each document from the URL you provide and converts it inside your run with open-source parsers. Downloaded files are deleted right after conversion. The results are stored only in your run's dataset and key-value store in your Apify account, and they are kept for the data retention period of your Apify plan.
How does the price compare?
The run start costs $0.00005, while many document converters in Apify Store charge $0.001–$0.005 per run start. Failed documents, HTML pages and scans with OCR off are free. A run that converts one 10-page document costs about $0.003 in total, including the run start.
How is it different from other PDF text extractors?
One tool handles PDF and Office documents, returns tables as JSON, builds RAG chunks with page numbers and does not charge for failed documents.
Other tools from mcpkit
- Website Tech Stack Detector & Technology Lookup: find the CMS, frameworks, analytics and ad pixels of any website, plus the company's email provider and SaaS tools from DNS. Bulk domains for lead enrichment, $0.002 per domain.
- Merge, Dedupe & Transform Datasets: merge Apify datasets and CSV, JSON or Excel files, remove duplicates, filter rows and export clean CSV or XLSX, no code. $0.05 per 1,000 rows.