PDF to Markdown Converter – PDF Parser for LLM & RAG
Pricing
from $3.00 / 1,000 converted pdfs
PDF to Markdown Converter – PDF Parser for LLM & RAG
Convert PDF links or uploaded PDFs into clean Markdown: headings, lists, tables, page numbers, metadata and RAG chunks. Fast text extraction, no OCR (scanned and failed files are free). $3 per 1,000 PDFs, first 20 pages included.
Pricing
from $3.00 / 1,000 converted pdfs
Rating
0.0
(0)
Developer
CleanData Labs
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
PDF to Markdown Converter for LLMs & RAG – Headings, Tables, Page Markers & Metadata
What does PDF to Markdown do?
PDF to Markdown is a PDF to Markdown converter and PDF text extraction API for LLMs, RAG pipelines and AI agents. Give it PDF links or upload PDF files, and it returns each document as clean, structured Markdown: headings (#, ##, ###), bullet and numbered lists, tables as Markdown tables, page markers you can cite, plus title, author, dates and page count.
It runs on a fast, open-source engine (no OCR, no AI model calls), so a typical 10–20 page PDF converts in 1–3 seconds, and you only pay for PDFs that were converted. Broken links, blocked downloads, scanned PDFs without a text layer, password-protected files and duplicates are free.
Need web pages too? Use our URL to Markdown Converter for HTML pages, sitemaps and small crawls. It reads PDFs as plain text; this Actor keeps the PDF's structure.
Why use it
- Structure, not just text: headings detected from font size and weight, bullet and numbered lists, paragraphs re-joined across line breaks, hyphenated words repaired, ligatures (fi, fl) fixed
- Tables: tables with cell borders become Markdown tables (
| a | b |) - Multi-column layouts (scientific papers, reports) are read column by column
- Clean output: repeated page headers/footers and bare page numbers are removed
- Page markers
<!-- page N -->and an optional per-page output for citations - Page selection:
"1-5","1,3,10-12","20-","-1"(last page) - Metadata: title (from the PDF, or the first heading), author, subject, keywords, creator, created/modified dates, page count, file size, SHA-256
- RAG chunks with overlap, each tagged with the page it starts on
- Inputs: PDF URLs, uploaded files (stored in an Apify key-value store), or every PDF in a key-value store
- Clear errors with a code (
no-text-layer,password-protected,not-a-pdf,not-found,blocked,file-too-large,invalid-pdf) instead of a failed run - Password-protected PDFs: pass the password (stored encrypted)
- Respects robots.txt by default; honest User-Agent
- Works as a tool for AI agents via the Apify API and MCP
How to use PDF to Markdown
- Open the Actor in Apify Console (click Try for free on this page) and sign in or create a free Apify account.
- Paste PDF links into PDF URLs, or use Upload PDFs to add files from your computer.
- Optional: set Pages to convert (e.g.
1-10), turn on Per-page output, or set Chunk size for RAG. - Click Start. When the run finishes, open the Output tab and download the results as JSON, CSV, Excel or HTML.
- To repeat it, create a Schedule, or call the Actor from your app via the Apify API.
Input examples
Convert a few PDFs:
{"urls": ["https://arxiv.org/pdf/1706.03762", "https://bitcoin.org/bitcoin.pdf"]}
First 5 pages only, one Markdown per page, plus RAG chunks:
{"urls": ["https://arxiv.org/pdf/1706.03762"],"pageRange": "1-5","perPageOutput": true,"chunkSizeTokens": 800,"chunkOverlapTokens": 80}
Convert every PDF stored in one of your key-value stores:
{"keyValueStoreId": "username~my-pdfs","keyValueStoreKeyPrefix": "invoice-"}
Output example
{"source": "https://arxiv.org/pdf/1706.03762","fileName": "1706.03762v7.pdf","title": "Attention Is All You Need","titleSource": "first-heading","author": null,"createdAt": "2024-04-10T21:11:43+00:00","pageCount": 15,"pagesConverted": 15,"pagesWithoutText": [],"tablesFound": 1,"markdown": "<!-- page 1 -->\n\n# Attention Is All You Need\n\n...\n\n## 1 Introduction\n\nRecurrent neural networks ...","characters": 38817,"words": 5965,"approxTokens": 9704,"warnings": [],"error": null}
With perPageOutput you also get pages: [{ "page": 1, "markdown": "...", "tables": 0, "hasTextLayer": true }]; with chunkSizeTokens you get chunks: [{ "index": 0, "page": 1, "text": "...", "approxTokens": 790 }].
A PDF that could not be converted comes back as a free row:
{ "source": "https://example.org/scan.pdf", "errorCode": "no-text-layer", "error": "The PDF has no text layer on any of the 1 converted pages (scanned images). OCR is not included, so nothing was extracted.", "blocked": false }
How much does it cost?
PDF to Markdown uses pay-per-event pricing. You pay only for PDFs that were actually converted; there is no separate compute charge.
| Event | Price | When it is charged |
|---|---|---|
| Converted PDF | $0.003 ($3 per 1,000 PDFs) | Once per converted PDF. Includes the first 20 pages. |
| Extra page | $0.00005 ($0.05 per 1,000 pages) | Each converted page above 20 in the same PDF |
| Actor start | $0.00005 | Apify's standard start event, once per run (per GB of memory) |
| Document | Price |
|---|---|
| 1–20 pages | $0.003 |
| 60 pages | $0.005 |
| 100 pages | $0.007 |
| 500 pages | $0.027 |
Free (never charged): failed downloads (404, timeouts), blocked or robots.txt-disallowed URLs, scanned PDFs without a text layer, password-protected files without the right password, files that are not PDFs, files over the size limit and duplicate files in the same run. They come back as rows with an errorCode, so you can see what happened.
Budget control: set Maximum cost per run in the run options (minimum $0.10). The Actor stops cleanly when the limit is reached and keeps everything converted so far. Use Pages to convert or Max pages per PDF to cap long documents.
Apify's free plan includes $5 of platform credit every month, enough to convert over 1,500 short PDFs before you pay anything.
Limits at a glance
- No OCR (yet). Scanned pages have no text layer. Fully scanned PDFs return a free
no-text-layerrow; in mixed PDFs the scanned pages are listed inpagesWithoutText. - Borderless tables are not rebuilt as tables. Tables drawn with cell borders become Markdown tables; tables without borders (common in scientific papers) come out as text lines in reading order.
- Images, charts and formulas are not converted.
- Defaults: up to 200 pages per PDF (
maxPages, 0 = no limit), 50 MB per file (maxFileSizeMb, up to 500), 300 s per PDF (perPdfTimeoutSecs).
Use with AI agents (MCP)
PDF to Markdown works as a ready-made tool for Claude, ChatGPT, Cursor, VS Code and any other MCP client through the official Apify MCP server. The agent gets one tool, cleandata-labs--pdf-to-markdown, and you pay the normal pay-per-event price from your Apify account.
MCP server URL with only this Actor:
https://mcp.apify.com?tools=cleandata-labs/pdf-to-markdown
On first connection your client opens the Apify sign-in (OAuth). To use an API token instead, send the header Authorization: Bearer <YOUR_APIFY_TOKEN>.
Cursor (~/.cursor/mcp.json):
{"mcpServers": {"pdf-to-markdown": { "url": "https://mcp.apify.com?tools=cleandata-labs/pdf-to-markdown" }}}
Claude Code:
$claude mcp add --transport http pdf-to-markdown "https://mcp.apify.com?tools=cleandata-labs/pdf-to-markdown"
Web pages and PDFs in one connection: https://mcp.apify.com?tools=cleandata-labs/url-to-markdown,cleandata-labs/pdf-to-markdown.
Tips for agents
- Smallest useful input:
{"urls": ["<PDF link>"], "pageRange": "1-5", "maxCharacters": 20000}. - A 10–20 page PDF usually takes 1–3 seconds to convert, so results are ready within the MCP call's default wait.
- Each row has
approxTokensandpageCount, so the agent can decide how much to read. UsepageRangeormaxCharactersto keep long documents small. - If
errorCodeisno-text-layer, the PDF is a scan: it needs OCR, which this Actor does not do.
Example prompts
- "Convert https://arxiv.org/pdf/1706.03762 to Markdown and list its section headings."
- "Read pages 1–5 of this PDF: , and summarize the key numbers in a table."
- "Convert these 20 PDF reports into 800-token chunks with page numbers for my RAG index."
Integrations
- Make, Zapier and n8n – start a run and process the Markdown in your no-code workflows.
- Google Sheets – export titles, page counts and text to a spreadsheet.
- Webhooks – get notified when a run finishes or fails.
- Apify API and clients – Python or JavaScript
apify-client. - AI agents – through the Apify MCP server or the LangChain / LlamaIndex integrations.
Python example:
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_TOKEN>")run = client.actor("cleandata-labs/pdf-to-markdown").call(run_input={"urls": ["https://bitcoin.org/bitcoin.pdf"]})for item in client.dataset(run.default_dataset_id).iterate_items():print(item["title"], item["pageCount"], item["markdown"][:200])
Notes & limitations
- No OCR and no borderless-table detection yet: see Limits at a glance.
- Headings are detected from font size and weight; unusual layouts (posters, slides, forms) can give extra or missing headings.
- Text inside charts may appear as short text lines. Math is kept as plain characters.
- Some PDFs use fonts without a Unicode mapping; their text comes out as
(cid:N)and the row gets a warning. - "Tokens" are approximated as characters ÷ 4.
- You are responsible for having the right to process the documents you convert.
FAQ
Does it need an API key or an AI model? No. Extraction runs on open-source libraries (pdfplumber and pdfminer.six, MIT license) inside the Actor. No document is sent to a third-party AI service.
Can it read scanned PDFs? No, there is no OCR. You get a clear no-text-layer row, and you are not charged.
What about password-protected PDFs? Put the password in PDF password (stored encrypted). Without it you get a free password-protected row.
How do I convert files from my computer? Use Upload PDFs in the input form. The files are stored in an Apify key-value store and converted like any URL.
Why was a PDF not charged? Only converted PDFs are charged. Errors, blocked downloads, scans without text, password-protected files and duplicate files in the same run are free.
More tools from CleanData Labs
Other Actors from the same publisher, built the same way (pay only for delivered results, errors are free, MCP-ready):
- URL to Markdown Converter: Convert web pages into clean, LLM-ready Markdown with metadata, small crawls via links or sitemap, JavaScript fallback and RAG chunks.
- Keyword Research Tool — Autocomplete & Trends: Keyword ideas from Google Autocomplete plus Google Trends direction and rising searches, in one compact JSON per keyword.
- Google Trends Scraper: Google Trends data without an API key: interest over time, by region, related and rising queries.
- Google Ads Transparency Scraper: Export any company's Google ads by brand, website or advertiser ID.
Typical combo: convert a documentation site with URL to Markdown and its PDF manuals here, then load both into the same RAG index.