Any URL to Markdown: Web Pages, PDF, Word and Excel for LLMs

One link in, LLM-ready Markdown out, whether the link is a web page, a PDF, an Office file or a scanned image.

Run on Apify →See pricing

What it does

AI agents and RAG pipelines keep running into links they cannot read directly: a PDF report, a linked spreadsheet, a slide deck, an article page full of navigation. Each format usually means another library. Any URL to Markdown works out what the link actually is and routes it to the right converter, so your code only ever handles Markdown.

It handles web pages (main content kept with Mozilla Readability, robots.txt respected), PDFs (text layer read with heading and paragraph detection), Word, Excel and PowerPoint, OpenDocument, EPUB, CSV and JSON. Images and PDF pages without a text layer go through Tesseract OCR in 7 languages. Headings, lists, tables and links are kept, and every result includes a title, metadata, the route used and a tokenEstimate.

Pricing follows what was converted: $1 per 1,000 web pages, $2 per 1,000 documents (a PDF counts once per started 50 text pages) and $3 per 1,000 OCR pages. Failed downloads, unsupported files, robots-blocked pages and empty results are not charged. It fits MCP clients, LangChain or LlamaIndex pipelines, Clay enrichments and n8n, Make or Zapier flows.

How it works

  1. You pass a single url, or a list in urls (up to 1,000 per run, duplicates removed).
  2. The actor checks robots.txt (on by default), downloads the link and detects its real format rather than trusting the file extension.
  3. It routes the file to a converter: Readability for HTML, a layout-aware PDF text reader, Office and EPUB converters, or Tesseract OCR for images and scanned pages when ocr is on.
  4. The result is one row per URL with markdown, title, detectedFormat, route, tokenEstimate and metadata such as author, dates and page count.
  5. Limits such as maxPdfPages, maxOcrPages and maxRowsPerSheet keep large files in check, and truncated results are flagged.

Input example

A typical run input (JSON). Every field is also available as a form in the Apify console.

{
  "url": "https://arxiv.org/pdf/1706.03762",
  "urls": [
    "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
    "https://calibre-ebook.com/downloads/demos/demo.docx"
  ],
  "onlyMainContent": true,
  "ocr": true,
  "ocrLanguages": [
    "eng"
  ],
  "maxPdfPages": 500,
  "respectRobotsTxt": true
}
All input fields
FieldTypeRequiredDefaultWhat it does
urlstringnoOne link to convert: a web page, PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), OpenDocument, EPUB, CSV, JSON or image. The file type is detected automatically.
urlsarraynoOptional: more links to convert in the same run (up to 1,000 in total, duplicates removed).
includeTextbooleannofalseAdd a text field with the Markdown syntax removed.
onlyMainContentbooleannotrueKeep only the article or main content of web pages (navigation, footers and cookie banners removed). Turn off to convert the whole page body.
ocrbooleannotrueRead text from images (PNG, JPEG, TIFF, WebP, GIF, BMP) and from PDF pages that have no text layer, with Tesseract OCR. Turn off to never pay for OCR: images and scanned pages are then reported as errors (free).
ocrLanguagesarrayno["eng"]Languages in your scanned documents (up to 3). For 29 languages and word boxes use the OCR to Text actor.
maxOcrPagesintegerno20Upper limit of scanned pages read by OCR in one PDF ($0.003 each). Pages beyond it are left out and the row is marked truncated.
maxPdfPagesintegerno500Read at most this many pages of each PDF.
maxRowsPerSheetintegerno1000Excel, OpenDocument and CSV tables are cut after this many rows (marked truncated).
respectRobotsTxtbooleannotrueSkip URLs that the site's robots.txt disallows. It is checked before every request: web pages, direct file links and every redirect target. A robots.txt that answers with a server error counts as disallow-all (RFC 9309).

Output example

The sample shows a PDF, a Wikipedia article, a Word file, a spreadsheet and an image, each converted to Markdown with the route and token estimate.

urldetectedFormatroutetitletokenEstimatemarkdown
https://arxiv.org/pdf/1706.03762pdfpdf-textAttention Is All You Need9600Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures…
https://en.wikipedia.org/wiki/Retrieval-augmented_generationhtmlhtmlRetrieval-augmented generation - Wikipedia5811Retrieval-augmented generation (RAG) is a technique that enables large language models…
https://calibre-ebook.com/downloads/demos/demo.docxdocxofficeDOCX Demo2604# Demonstration of DOCX support in calibre\n\nThis document demonstrates the ability of the calibre DOCX Input plugin…
https://raw.githubusercontent.com/apache/poi/trunk/test-data/spreadsheet/SampleSS.xlsxxlsxofficeSample Spreadsheet96## First Sheet\n\n| Test spreadsheet | column_B |\n| --- | --- |\n| 2nd row | 2nd row 2nd column |…

Pricing

Pay per event: you are charged only for the results you receive, with no subscription. Set a maximum total charge on any run and it stops cleanly at the cap.

Charged forWhenPricePer 1,000Worked example
Page resultCharged per web page converted to Markdown$0.001$11,000 web pages = $1.00
Document convertedCharged per PDF (each started 50 text pages), Word, Excel, PowerPoint, OpenDocument, EPUB, CSV or JSON file converted$0.002$2A 15-page PDF = $0.002; a 120-page PDF = $0.006; 1,000 Word files = $2.00
Page ocrCharged per image, or scanned PDF page, read by OCR$0.003$3A 10-page scanned PDF = $0.03
Actor Start (platform start fee)Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event).$0.00005—One run at 1 GB = $0.00005

Prices are read from the live Apify Store listing when this page is built. The listing is always authoritative.

Try Any URL to Markdown on Apify. Pay only for the results you get.

Run on Apify →

Use cases

Document ingestion for RAG

Point it at the PDFs, docs and pages you want in a vector store and chunk the returned Markdown by heading. The tokenEstimate helps plan chunk sizes and embedding costs. See the PDF to Markdown for RAG guide.

Reading tool for AI agents

Give an MCP agent one tool that reads whatever it finds while browsing. One string goes in and one Markdown string comes out, so the agent does not need to know whether a link is a PDF or a spreadsheet.

Spreadsheets and decks as LLM context

Excel sheets become Markdown tables and slide decks become readable text, so a linked financial table or pitch deck can be summarised or queried by an LLM.

Enrichment in Clay or n8n

Add a step that turns a company's linked report or policy page into Markdown inside a no-code flow, then pass it to a summarisation step.

How it compares

ActorForge Any URL to MarkdownWeb scraper plus separate file parsersBrowser-based crawler
PDF, Office, EPUB, CSV and JSON in one callYesOnly with several librariesUsually HTML only
OCR for images and scanned pagesYes, 7 languagesSeparate OCR tool neededNo
JavaScript-rendered pagesNo, static HTML only (reported, not charged)DependsYes
Crawls a whole siteNo, converts the URLs you give itYes, if you build itYes
Token estimate per resultYesNoRarely
Pages behind a loginNoPossible with your own codeOften possible

If your sources are JavaScript-heavy apps or sit behind a login, a browser-based crawler is the better choice. For mixed links to documents and ordinary pages, one converter is simpler than maintaining a scraper, a PDF parser, an Office converter and an OCR engine.

Limits and honest notes

FAQ

How do I convert a URL to Markdown for an LLM?

Pass the link as url and read the markdown field of the result. The actor detects whether it is a web page, PDF, Office file, EPUB, CSV, JSON or image and picks the converter for you.

How accurate is the token estimate?

tokenEstimate is the character count divided by 4. It is a good guide for English text with GPT and Claude tokenizers, but not an exact count.

Which files can it not convert?

Legacy binary Office files (.doc, .xls, .ppt), RTF, OpenDocument presentations, HEIC/AVIF images and SVG are not supported. Password-protected PDFs and pages behind a login cannot be read either. These are reported with a reason and never charged.

How much does converting a long PDF cost?

A PDF is charged $0.002 per started 50 text pages, so a 15-page PDF costs $0.002 and a 120-page PDF costs $0.006. Scanned pages read by OCR cost $0.003 each, up to maxOcrPages (20 by default) per PDF.

Can I turn off OCR to keep costs predictable?

Yes. Set ocr to false and images or scanned pages are reported as errors instead of being read, at no charge. For 29 OCR languages and word boxes, use OCR to Text.

Use it from code

Run the actor through the Apify API with the input above.

cURL

curl -X POST "https://api.apify.com/v2/acts/actor-forge~any-url-to-markdown/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://arxiv.org/pdf/1706.03762", "urls": ["https://en.wikipedia.org/wiki/Retrieval-augmented_generation", "https://calibre-ebook.com/downloads/demos/demo.docx"], "onlyMainContent": true, "ocr": true, "ocrLanguages": ["eng"], "maxPdfPages": 500, "respectRobotsTxt": true}'

JavaScript (Node.js)

// Node.js 18+ (built-in fetch). Set APIFY_TOKEN in your environment.
const input = {
  "url": "https://arxiv.org/pdf/1706.03762",
  "urls": [
    "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
    "https://calibre-ebook.com/downloads/demos/demo.docx"
  ],
  "onlyMainContent": true,
  "ocr": true,
  "ocrLanguages": [
    "eng"
  ],
  "maxPdfPages": 500,
  "respectRobotsTxt": true
};

const res = await fetch(
  "https://api.apify.com/v2/acts/actor-forge~any-url-to-markdown/run-sync-get-dataset-items",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.APIFY_TOKEN}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(input),
  }
);
const items = await res.json();
console.log(items.length, items[0]);

Python

# pip install apify-client   (set APIFY_TOKEN in your environment)
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run_input = {
    "url": "https://arxiv.org/pdf/1706.03762",
    "urls": [
        "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
        "https://calibre-ebook.com/downloads/demos/demo.docx"
    ],
    "onlyMainContent": True,
    "ocr": True,
    "ocrLanguages": [
        "eng"
    ],
    "maxPdfPages": 500,
    "respectRobotsTxt": True
}

run = client.actor("actor-forge/any-url-to-markdown").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

The run-sync-get-dataset-items endpoint waits for the run (up to 5 minutes) and returns the dataset rows directly. For longer runs, start the run asynchronously and read the dataset when it finishes, as the Python example does. Replace APIFY_TOKEN with your own token from the Apify console.

Step-by-step guides

How to Convert PDF to Markdown for RAG Pipelines

Send your PDF links to the Any URL to Markdown actor, read the markdown field of each result, then split it by heading into token-sized chunks…

Related actors

OCR — Scanned PDF & Image to Text (Tesseract, 29 Languages)

Extract text from scanned PDFs and images (PNG, JPEG, TIFF, WebP, GIF, BMP) with Tesseract 5 OCR in 29 languages. PDF pages that already have text…

$3 per 1,000 · page ocr

PDF OCR — Scanned PDF to Searchable Text (29 Languages)

OCR scanned PDFs to text page by page with Tesseract 5 in 29 languages. Pages that already have a text layer are read directly at a tenth of the…

$3 per 1,000 · page ocr

Wayback Machine Scraper — Archive.org Snapshots & URL History

Every Wayback Machine (archive.org) capture of a URL, folder, host or domain: timestamp, status, MIME type, digest and archive links. Unique…

$2 per 1,000 · snapshot

Try Any URL to Markdown on Apify. Pay only for the results you get.

Run on Apify →

More Documents, OCR & AI-Ready Text tools · All actors