PDF to Markdown — LLM-Ready Text Extractor for RAG avatar

PDF to Markdown — LLM-Ready Text Extractor for RAG

Pricing

from $0.50 / 1,000 converted pdf pages

Go to Apify Store
PDF to Markdown — LLM-Ready Text Extractor for RAG

PDF to Markdown — LLM-Ready Text Extractor for RAG

Convert PDF URLs to clean Markdown for LLMs and RAG: headings, paragraphs, lists, page numbers, metadata and token estimates. One item per PDF or per page. $0.0005 per page, scanned pages are free.

Pricing

from $0.50 / 1,000 converted pdf pages

Rating

0.0

(0)

Developer

North Eng

North Eng

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 days ago

Last modified

Security

Limited permissions

Share

PDF to Markdown converts PDF files (by URL) into clean, structured Markdown that LLMs and RAG pipelines understand: headings detected from font sizes, paragraphs re-flowed, hyphenated line breaks fixed, bullet and numbered lists, page numbers removed, and optional <!-- page N --> markers so you can cite the source page.

It runs on a pure-JavaScript PDF engine (Mozilla pdf.js) — no browser, no OCR service, no API keys — so it is fast and cheap: a 15-page research paper converts in about 2 seconds.

What it does

  • Structure, not just text: #/##/### headings from font sizes, real paragraphs (wrapped lines joined), - bullet lists and numbered lists.
  • Clean text: de-hyphenation (trans- + formers → transformers, but English-to-German is kept), page numbers and rotated margin text (e.g. arXiv side stamps) removed, footnote markers kept with their words.
  • Page control: convert only 1-3,7 with Page range, cap pages per PDF, and choose one item per document or one item per page (great for page-level citations in RAG).
  • Metadata: file name and size, page count, title, author, subject, keywords, creator, producer, created/modified dates, word count and token estimate.
  • Works with share links: Google Drive (/file/d/…/view) and Dropbox (?dl=0) links are turned into direct downloads automatically.
  • Honest about scans: if a PDF has no text layer (scanned images), the item says needsOcr: true — and those pages are not charged.
  • Huge documents: a 1,298-page government budget converts in under 30 seconds; documents too big for one dataset item get a 1M-character preview plus a link to the full Markdown file.

Why use it

  • RAG / vector databases — chunk research papers, manuals, contracts, reports and filings into a knowledge base.
  • LLM prompts — Markdown keeps headings and lists, so models answer better than with raw pdftotext output, using fewer tokens.
  • Automations — call it from Make, Zapier, n8n or the Apify API whenever a new PDF appears.

How to use

  1. Add one or more PDF URLs (direct links, Google Drive or Dropbox share links).
  2. Optional: set a Page range or Output = one item per page.
  3. Click Start. Each PDF's Markdown is in the markdown field; export as JSON, CSV or Excel, or fetch via the API.

Input

FieldDefaultWhat it does
urls"Attention Is All You Need" (arXiv)PDF URLs to convert.
outputModedocumentdocument = one item per PDF. page = one item per page (with pageNumber).
pageRangeall pagesPages to convert, e.g. 1-5, 1,3,8-10, 10- (from 10 to the end).
maxPagesPerPdf500Safety cap on pages converted from each PDF (also caps cost).
includePageMarkerstrueInsert <!-- page N --> before each page in document mode.
maxFileSizeMb100Larger files are skipped with TOO_LARGE (not charged).
timeoutSecs120Download timeout per PDF.
maxConcurrency2PDFs processed in parallel.

Example:

{
"urls": [
{ "url": "https://arxiv.org/pdf/1706.03762" },
{ "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" }
],
"pageRange": "1-5",
"outputMode": "page"
}

Output

Real example from the default input (Oct 22 2026, Markdown shortened):

{
"url": "https://arxiv.org/pdf/1706.03762",
"finalUrl": "https://arxiv.org/pdf/1706.03762",
"fileName": "1706.03762v7.pdf",
"fileSizeBytes": 2215244,
"numPages": 15,
"pagesExtracted": 15,
"pageNumbers": [
1,
2,
3,
"…",
15
],
"title": null,
"author": null,
"subject": null,
"keywords": null,
"creator": "LaTeX with hyperref",
"producer": "pdfTeX-1.40.25",
"createdAt": "2024-04-10T21:11:43.000Z",
"modifiedAt": "2024-04-10T21:11:43.000Z",
"markdown": "<!-- page 1 -->\n\nProvided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures in this paper solely for use in journalistic or scholarly works.\n\n## Attention Is All You Need\n\n…\n\n### Abstract\n\nThe dominant sequence transduction models are based on complex recurrent or convolutional neural networks that include an encoder and a decoder.…",
"charCount": 40075,
"wordCount": 6496,
"tokensEstimate": 10019,
"needsOcr": false,
"truncated": false,
"error": null,
"extractedAt": "2026-10-22T23:58:45.508Z"
}

In page mode each item has pageNumber, markdown, charCount and wordCount instead. If a document is too large for one dataset item (over ~8 MB of text), markdown holds the first 1,000,000 characters, markdownIsPreview is true, and markdownFileUrl links to the full .md file in the run's key-value store (charCount and wordCount always describe the full document).

Failed PDFs are listed with error and errorCode and are not charged:

{
"url": "https://example.com/",
"error": "Not a PDF (content-type: text/html; charset=utf-8, 577 bytes). If this is a web page, use a web-page-to-Markdown Actor instead.",
"errorCode": "NOT_A_PDF"
}

Error codes: HTTP_404 (and other statuses), NOT_A_PDF, ENCRYPTED (password-protected), INVALID_PDF, BAD_PAGE_RANGE, TOO_LARGE, TIMEOUT, NETWORK_ERROR, BLOCKED_URL (the URL or a redirect resolves to a private, local or cloud-metadata address; such PDFs are never downloaded). A run summary is saved to the key-value store as OUTPUT.

Pricing

Pay per page — you only pay for pages that actually contain text:

EventPrice
Converted PDF page (pages with extractable text)$0.0005 ($0.50 per 1,000 pages)
Actor startApify default ($0.00005)

Examples: a 15-page paper costs $0.0075; a 142-page IRS publication $0.071. Blank and scanned pages are free, failed downloads are free, and there is no per-file fee. Set a max cost per run to cap spending — the Actor stops converting when the budget is reached and keeps what it has done.

FAQ

Does it do OCR on scanned PDFs? No. It extracts the PDF's text layer. Scanned pages are flagged with needsOcr: true and cost nothing.

Can it read password-protected PDFs? No — they are reported as ENCRYPTED and not charged.

How accurate are tables? Table cells come out as text lines in reading order; complex multi-column tables are not rebuilt as Markdown tables. Headings, paragraphs and lists are reliable for typical reports, papers and manuals.

Can I upload a file instead of a URL? Upload it anywhere that gives a public link (Google Drive, Dropbox, S3, the Apify key-value store) and paste that link.

Limitations

  • Text-based PDFs only (no OCR).
  • Multi-column layouts are read in the PDF's content order, which is correct for most papers but can interleave columns in some magazine layouts.
  • Only publicly downloadable URLs (no login-protected files).