Document to Markdown Converter for AI avatar

Document to Markdown Converter for AI

Pricing

from $15.00 / 1,000 document converteds

Go to Apify Store
Document to Markdown Converter for AI

Document to Markdown Converter for AI

Convert PDF, DOCX, PPTX, XLSX, EPUB, HTML and images (with OCR) from public URLs into clean Markdown and structured JSON for AI agents and RAG.

Pricing

from $15.00 / 1,000 document converteds

Rating

0.0

(0)

Developer

Chris O'Byrne

Chris O'Byrne

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

11 days ago

Last modified

Security

Limited permissions

Share

Turn documents from public URLs into clean Markdown and structured JSON that language models, RAG pipelines and AI agents can use directly. It reads PDF, DOCX, PPTX, XLSX, EPUB, HTML and images (PNG, JPEG, TIFF, BMP, WEBP, GIF), with OCR for scanned pages.

Each output record has the Markdown text, the tables as CSV or JSON, the headings with levels and page numbers, page and word counts, an OCR flag, document metadata and warnings. Layout is recovered with reading order, so multi-column pages and tables come out as text a model can follow.

Who it is for

  • Developers feeding documents into vector databases, knowledge bases or prompts
  • AI agent builders who need one tool call that turns a link into usable text
  • Analysts who want tables out of PDFs, slide decks and spreadsheets as CSV
  • Teams that must handle mixed files (Word, PowerPoint, Excel, EPUB, scans) with one input format

What it does

  1. Downloads each URL (http or https only, up to 50 MB).
  2. Detects the format from the file content, not the file name.
  3. Converts it with Docling, an open source document converter (MIT licence). If Docling fails on a file, the MarkItDown library (MIT licence) is used as a fallback and a warning says so.
  4. Reads scanned pages and images with OCR when OCR is on. Pages that already have a text layer are never sent to OCR.
  5. Pushes one record per URL and deletes the downloaded file.

All AI models are baked into the image, so runs make no model downloads and your documents are not sent to any third-party AI service.

Input

FieldMeaning
urlsPublic document links, up to 200 per run
ocrRead scanned pages and images (default on)
ocrQualityfast (default) or high, a larger model for noisy scans
pageRangePDF only, for example 1-10, 5 or 3-
includeMarkdownInclude the Markdown text (default on)
tableFormatcsv, json, both or none
tableModefast (default) or accurate for complex tables, about 1.5 times slower
includeDoclingJsonSave the full structured document to the key-value store
maxPagesPerDocumentRefuse documents above this many pages, up to 200
maxFileSizeMbRefuse files above this size, up to 50

Example input:

{
"urls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"],
"pageRange": "1-3",
"ocr": true,
"tableFormat": "csv"
}

Output

One record per URL, in the dataset. A shortened example:

{
"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
"status": "ok",
"format": "pdf",
"engine": "docling",
"markdown": "## Form W-9\n\n(Rev. March 2024)\n\nDepartment of the Treasury ...",
"tables": [{"index": 1, "page": 3, "num_rows": 6, "num_columns": 2, "csv": "IF the entity/individual ...,THEN check the box for ...\n..."}],
"headings": [{"level": 2, "text": "Form W-9", "page": 1}],
"page_count": 6,
"pages_processed": 3,
"word_count": 3650,
"ocr_used": false,
"ocr_pages": 0,
"metadata": {"title": "Form W-9 (Rev. March 2024)", "pages_converted": "1-3", "file_size_bytes": 140815},
"warnings": [],
"charged": true
}

A document that cannot be converted still gets a record with status "error", an error_code (for example private_address, file_too_large, too_many_pages, password_protected, unsupported_format, no_text_extracted, http_error) and a plain message. Error records are never charged.

What counts as a page: a PDF page, a PPTX slide, an XLSX sheet, or one image. DOCX, HTML and EPUB have no fixed pages, so they count 1 page per 1,000 words, rounded up. The warnings list says when this estimate was used.

Pricing

Pay per event. You are charged only for documents that were converted and produced text.

EventPriceWhen
Document converted$0.015Once per successfully converted document
Page processed$0.006Per page in a converted document
OCR page$0.015Per page that had no text layer and was read with OCR, on top of the page price

Examples: a 10-page PDF with text costs $0.075. A 10-page scanned PDF costs $0.225. A 30,000-word EPUB counts as 30 pages and costs $0.195. Apify also adds its standard run start charge, a fraction of a cent. Set a maximum cost per run in the run options: the Actor skips any document that could exceed the remaining budget, without charge.

Limits and safety

  • Maximum 50 MB and 200 pages per document. Larger files and longer PDFs are refused without charge. Use pageRange to convert part of a long PDF.
  • Only http and https on ports 80, 443, 8080 and 8443. URLs that resolve to private, loopback, link-local or cloud metadata addresses are refused, also after every redirect.
  • Downloaded files are deleted after each document. Document content is never written to the run log.
  • Legacy .doc, .ppt and .xls, password protected files, and files behind a login are not supported.
  • OCR is tested on English, French, German, Spanish, Polish, Portuguese, Italian and Chinese text, which read accurately with either OCR quality setting. For Japanese, set ocrQuality to high: the fast setting misreads Japanese characters. Cyrillic text (Russian, Ukrainian and similar) is not read correctly yet with either setting. Handwriting and very low quality scans may give weak results.
  • Speed on the platform with 4 GB: about 5 to 10 seconds per text PDF page, about 10 to 20 seconds per scanned page, and a fixed 30 to 45 seconds of start-up per run. Office, HTML and EPUB files take a few seconds.
  • Table extraction can miss or merge cells in complex layouts. Try tableMode accurate.
  • The link in docling_json_url needs your Apify API token or the Console.

Sources and licences

The Actor runs on Docling (MIT) and MarkItDown (MIT). The baked-in model weights are the Docling layout model (Apache-2.0), the TableFormer table model (CDLA-Permissive-2.0) and PaddleOCR PP-OCRv6 models run through RapidOCR (Apache-2.0). Documents you convert keep whatever rights and licences they have; you are responsible for having the right to process them. This Actor is not affiliated with or endorsed by IBM, Microsoft, Docling, MarkItDown, PaddlePaddle or any other project named here.

FAQ

Does it work on scanned PDFs? Yes. Pages with no text layer are read with OCR and billed as OCR pages. Turn OCR off to skip them.

Why is a page charged for a Word file? Word, HTML and EPUB files have no fixed pages, so 1,000 words count as one page. Conversion of these formats is quick, and the price stays low.

Can I get the tables as data? Yes. Set tableFormat to csv, json or both. Each table has its page, row count and column count.

Is my document sent to an AI service? No. Everything runs inside the Actor container with models included in the image.

What if one URL fails? The other documents still run. The failed one gets an error record and no charge.

Can I use it from code or an agent? Yes, through the Apify API, the client libraries or the Apify MCP server. The output is plain JSON.

Support

Open an issue in the Issues tab of this Actor with the URL (if public), the format and the run ID. Bugs in conversion quality are tracked there as well.