PDF & Documents to Markdown / JSON avatar

PDF & Documents to Markdown / JSON

Pricing

from $1.75 / 1,000 converted pages

Go to Apify Store
PDF & Documents to Markdown / JSON

PDF & Documents to Markdown / JSON

Convert public PDF, Word, PowerPoint, Excel and HTML documents into clean Markdown and per-page JSON with headings, tables and metadata. Optional OCR. Pay per page.

Pricing

from $1.75 / 1,000 converted pages

Rating

0.0

(0)

Developer

Badr Bouargan

Badr Bouargan

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

What is PDF & Documents to Markdown / JSON?

PDF & Documents to Markdown / JSON turns public PDF, Word, PowerPoint, Excel and HTML documents into clean Markdown and structured JSON, so you can feed them to an LLM, a RAG pipeline, a search index or a spreadsheet. You pay per converted page, with no start fee.

  • Convert PDFs to Markdown with real headings, joined paragraphs, bullet lists and ruled tables as Markdown tables.
  • Get per-page JSON (optional): text, Markdown, headings and tables of every page, ready for chunking.
  • Read Word (.docx), PowerPoint (.pptx), Excel (.xlsx), HTML and text files too. The format is read from the file itself, not from the address. Web page menus, language lists and tables of contents are left out, so you do not pay for them.
  • Extract metadata: title, author, subject, keywords, creation and modification dates (ISO 8601) and language.
  • Read scanned PDFs with OCR (optional, open-source Tesseract engine, 7 languages).
  • Use your own files: point the Actor to one of your Apify key-value stores instead of public URLs.
  • Stay polite: each host's robots.txt is respected, no login, no CAPTCHA solving, no anti-bot bypass.

Use cases: AI and RAG teams loading reports and papers into a vector store, analysts pulling tables out of public filings, researchers batch-reading papers, no-code builders turning documents into rows for Make, n8n or Zapier.

What data can you extract from a PDF or document?

FieldDescriptionExample
📄 titleDocument title (metadata, else the biggest heading, else the file name)Form W-9 (Rev. March 2024)
🔗 urlAddress of the documenthttps://www.irs.gov/pub/irs-pdf/fw9.pdf
🧾 formatpdf, docx, pptx, xlsx, html or text (read from the bytes)pdf
📑 pages / pagesConvertedPages in the file / pages converted6 / 6
✍️ markdownThe whole document as MarkdownForm W-9 (Rev. March 2024) ...
📊 tablesFoundTables written as Markdown tables1
🧩 pagesDataOptional per-page JSON: text, Markdown, headings, tables, OCR flag[{"page": 1, ...}]
👤 metadata.authorAuthor from the file (null when the file has none)SE:W:CAR:MP
📅 metadata.createdAtCreation date, ISO 8601 UTC2024-03-06T13:18:13Z
🌐 metadata.languageISO 639-1 language, from the file or detecteden
✅ statusOK, BLOCKED, CUSTOMER_ERROR, UNSUPPORTED or FAILEDOK
💵 billablePages / billableOcrPagesPages billed for this row (0 for errors and duplicates)6 / 0

A value the document does not contain stays null; nothing is guessed.

How to convert a PDF to Markdown

  1. Click Try for free and create a free Apify account if you do not have one.
  2. Paste one or more document addresses into Document URLs (documentUrls), or pick one of your key-value stores in Your key-value store (keyValueStoreId). The Actor gets read-only access to that store only.
  3. Set Maximum pages per document (maxPagesPerDocument) and turn on Per-page JSON (outputPages) or OCR for scanned pages (ocr) if you need them.
  4. Click Start and wait a few seconds: a 15-page paper takes about one second to convert.
  5. Open the Overview or Markdown tab, or download the dataset as JSON, CSV, Excel or HTML.

Try it free: run with the default input. It converts two public IRS forms, W-9 and W-4 (11 pages), in under a minute.

How much does it cost to convert PDFs to Markdown?

Pay per event, no start fee. One "Converted page" is one PDF page or PowerPoint slide with text, or 3,000 characters of Markdown for DOCX, XLSX, HTML and text files (they have no fixed pages). A scanned page read with OCR is one "OCR page" instead.

EventFreeStarterScaleBusiness
Converted page (per 1,000)$2.50$2.25$2.00$1.75
OCR page (per 1,000)$16.00$14.40$12.80$11.20

Examples on the Free plan:

  • A 15-page research paper: 15 converted pages = about $0.04.
  • 100 reports of 20 pages: 2,000 converted pages = about $5.00.
  • A 10-page scanned contract with OCR: 10 OCR pages = about $0.16.

Never charged: errors, refusals (BLOCKED), unsupported files, empty pages, scanned pages left without OCR, and the same file twice in one run. Set Maximum cost per run in the run options: the Actor keeps only the pages that fit, marks the row truncated: true and stops cleanly. Apify's free plan gives you monthly platform credits to try it.

⬇️ Input

{
"documentUrls": [
"https://www.irs.gov/pub/irs-pdf/fw9.pdf",
"https://www.irs.gov/pub/irs-pdf/fw4.pdf"
],
"maxPagesPerDocument": 200,
"outputPages": false,
"extractTables": true,
"ocr": false
}
FieldWhat it doesDefault
documentUrlsPublic PDF, DOCX, PPTX, XLSX, HTML or text addressesprefilled demo
keyValueStoreId / keyValueStoreKeysYour own Apify store with files, read-only (all non-JSON records when no key is given)empty
maxDocumentsDocuments converted at most100
maxPagesPerDocumentFirst pages converted per document200
maxFileSizeMbLarger files are skipped (CUSTOMER_ERROR, free)50
outputPagesAdds pagesData, one JSON object per page (PDF and PPTX)false
extractTablesRuled PDF tables become Markdown tablestrue
pageMarkersAdds <!-- page N --> before each pagefalse
ocr / ocrLanguageReads scanned pages with Tesseract (eng, fra, deu, spa, ita, por, nld)false / eng
failRunOnErrorEnds the run FAILED when a document is not convertedfalse
proxyConfigurationDirect connection by default; datacenter or your own proxies allowedno proxy

Input form of PDF & Documents to Markdown with two document URLs

Real run nr2Ie0vxRs2zlBzJt · Nov 30, 2026 · two document URLs: an arXiv paper and the IRS Form W-9

⬆️ Output

One dataset row per document (shortened real row):

{
"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
"title": "Form W-9 (Rev. March 2024)",
"format": "pdf",
"pages": 6,
"pagesConverted": 6,
"billablePages": 6,
"billableOcrPages": 0,
"characters": 38053,
"tablesFound": 1,
"markdown": "Form W-9\n\n(Rev. March 2024)\n\nRequest for Taxpayer ...",
"metadata": {
"author": "SE:W:CAR:MP",
"subject": "Request for Taxpayer Identification Number and Certification",
"createdAt": "2024-03-06T13:18:13Z",
"language": "en",
"languageSource": "document"
},
"status": "OK",
"errorCode": null
}

Output table: PDF, DOCX, PPTX, XLSX and HTML rows, plus BLOCKED, CUSTOMER_ERROR and UNSUPPORTED rows billed 0 pages

Real run NrasG4WQpZwljoqwQ · Nov 30, 2026 · 14 inputs: PDF, Word, PowerPoint, Excel, HTML, a robots.txt-disallowed page, a 404, an image, a duplicate file and 3 files from a key-value store

Rows that could not be converted are kept, free, with a clear code:

statusWhenCharged
OKDocument convertedYes, per page
BLOCKEDrobots.txt forbids it, HTTP 401 / 403 / 429, CAPTCHA, anti-robot or login pageNo
CUSTOMER_ERRORInvalid URL, 404, unknown host, file too large, damaged fileNo
UNSUPPORTEDImage, old .doc / .xls / .ppt, password-protected PDF, scanned PDF without OCRNo
FAILEDHost down or timing out, also after 2 new triesNo

The run summary (RUN_SUMMARY in the key-value store) lists documents by status and code, pages converted and charged, and the stop reason. Rows larger than the 9 MB dataset limit keep a link (markdownUrl, pagesDataUrl) to the full content in the key-value store.

Integrations and API

Call the Actor from your code with the official apify-client for Python or Node.js (API reference).

from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("badr_xba/pdf-documents-to-markdown").call(run_input={
"documentUrls": ["https://www.irs.gov/pub/irs-pdf/fw4.pdf"],
"outputPages": True,
})
for doc in client.dataset(run["defaultDatasetId"]).iterate_items():
print(doc["title"], doc["pagesConverted"], len(doc["markdown"]))
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('badr_xba/pdf-documents-to-markdown').call({
documentUrls: ['https://www.irs.gov/pub/irs-pdf/fw9.pdf'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].markdown.slice(0, 500));
  • No-code: connect it to Make, n8n, Zapier, Google Sheets, Google Drive, Slack or Airbyte.
  • Webhooks: start your next step (embedding, indexing) when a run finishes.
  • Schedules: convert a list of reports every day or week.
  • MCP: use it from Claude, ChatGPT or Cursor through the Apify MCP server.

Other Actors you may like

❓ FAQ

The Actor only downloads documents that anyone can open without an account, and only when the host's robots.txt allows it. Copyright still applies to the content: check the licence of the documents you convert and how you reuse them. This is not legal advice.

What happens if a host blocks a request?

A refusal (HTTP 401, 403 or 429, a CAPTCHA, an anti-robot or login page) gives a BLOCKED row, is never charged and is not retried, except a 429 that asks to wait 10 seconds or less (one new try). Network errors, timeouts and HTTP 5xx get at most 2 new tries. The run still succeeds unless you turn on failRunOnError.

Does it work with scanned PDFs?

Yes, with OCR for scanned pages (ocr: true). Pages without a text layer are rendered and read with Tesseract, then billed as "OCR page". Without OCR they stay empty, free, and the row says NO_TEXT_LAYER or SCANNED_PAGES. OCR quality depends on the scan; handwriting is not supported.

How fast is it?

Text PDFs convert in about 10-70 ms per page; a 15-page paper takes about one second after download. OCR is much slower: about 12-14 seconds per scanned page with the default 512 MB memory (measured on 37 real scanned pages).

Can I use it with Python or through an MCP server?

Yes: see the Python and Node.js examples above, or add the Actor to the Apify MCP server for Claude, ChatGPT or Cursor.

Do I need a proxy?

No. The default is a direct connection, which is the cheapest and works for most public hosts. You can choose the Apify datacenter proxy or your own proxies; the residential proxy is not used (it is replaced by the datacenter proxy).

Can it read password-protected or login-only documents?

No. Password-protected PDFs return UNSUPPORTED (ENCRYPTED) and pages behind a login are never opened.

Limits

  • Not available yet: old binary Office formats (.doc, .xls, .ppt), images (PNG, JPG), handwriting OCR, JavaScript-rendered HTML pages.
  • Heading levels in PDFs come from font sizes, so documents that use one font size for everything get paragraphs without headings.
  • Tables are detected when they have ruling lines; borderless tables stay as text lines.
  • Files up to 50 MB and 2,000 pages per document.

Your feedback

Found a document that converts badly, or need a new format? Open an issue in the Issues tab with the URL and what you expected.

Not affiliated with Adobe, Microsoft, arXiv or the IRS. The document names are only used to describe compatibility.