PDF, DOCX and HTML to Markdown Converter (RAG) avatar

PDF, DOCX and HTML to Markdown Converter (RAG)

Pricing

from $4.00 / 1,000 document converteds

Go to Apify Store
PDF, DOCX and HTML to Markdown Converter (RAG)

PDF, DOCX and HTML to Markdown Converter (RAG)

Convert PDF, DOCX and HTML files to clean Markdown from URLs or uploaded files, with titles, lists, tables and optional RAG-ready chunks for LLM pipelines.

Pricing

from $4.00 / 1,000 document converteds

Rating

0.0

(0)

Developer

ClearCheck Tools

ClearCheck Tools

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Features

Limited permissions

Share

Turn PDF, Word (DOCX) and web page (HTML) files into clean, structured Markdown that LLMs and vector databases can use directly. Give it URLs or files you uploaded to Apify storage and get back, for each document: Markdown with headings, lists and tables, metadata (title, author, page count, detected language), and optional RAG-ready chunks with configurable size and overlap.

No external API, no AI service, no OCR bill: conversion runs inside the Actor, so it is fast and cheap.

What you get

  • PDF: headings detected from font sizes, bullet and numbered lists, tables with aligned columns turned into Markdown tables, repeated headers and footers removed, page count and PDF metadata (title, author, dates).
  • DOCX: Word headings and title styles, lists, tables, bold/italic, links; document properties (title, author, dates).
  • HTML: main article extraction (menus, ads, footers dropped), links made absolute, tables, lists, code blocks.
  • Language detection for every document (ISO 639-1 code such as en, fr, de).
  • RAG chunking: cuts along headings and paragraphs (tables and lists stay in one piece when they fit), overlap you control, and for every chunk: heading path, page range (PDF), exact character offsets, token estimate.
  • Two dataset layouts: one item per document, or flat {id, text, metadata} rows per chunk, ready to upsert into a vector store.
  • Failed documents never stop the run and are never charged.

Quick start

  1. Open the Actor, paste one or more URLs in Document URLs.
  2. (Optional) turn on Split into chunks for RAG.
  3. Click Start, then open the Output tab or download the dataset as JSON, CSV or Excel.

Using your own files

Create a key-value store in Console (Storage > Key-value stores), upload your files as records, then put their keys in Uploaded files and the store name or ID in Key-value store ID or name.

Input

FieldDescriptionDefault
urlsPublic URLs of PDF, DOCX or HTML documents. Format is detected from content.-
kvStoreKeys, kvStoreIdFiles stored in a key-value store.-
extractMainContentHTML: keep only the main article.true
maxPagesPerDocumentConvert only the first N pages of each PDF (0 = all).0
maxFileSizeMbSkip larger files (not charged).50
pdfPasswordPassword for protected PDFs (secret).-
enableChunkingAdd chunks to each document.false
chunkSize, chunkOverlapIn characters (about 4 characters per token).1500, 200
outputModedocuments or chunks.documents
saveMarkdownFilesAlso store each result as a .md file in the run's key-value store.false

Example input:

{
"urls": ["https://example.com/annual-report.pdf", "https://example.com/blog/post.html"],
"enableChunking": true,
"chunkSize": 1200,
"chunkOverlap": 150
}

Output

Default layout (outputMode: "documents"), abridged (real output of the test PDF):

{
"id": "f26767130f",
"source": { "type": "url", "url": "https://example.com/report.pdf" },
"status": "ok",
"format": "pdf",
"metadata": {
"title": "Annual Climate Report 2025",
"author": "Jane Doe",
"pages": 13,
"pagesEstimated": false,
"language": "en",
"wordCount": 933,
"characterCount": 6719,
"tokensEstimate": 1680,
"createdAt": "2026-11-19T12:59:37Z"
},
"markdown": "# Annual Climate Report 2025\n\n...\n\n| Region | Stations | Trend (C/decade) |\n| --- | --- | --- |\n| North | 12 | 0.31 |\n",
"chunks": [
{
"text": "...",
"headingPath": ["Annual Climate Report 2025", "1. Section 1: Regional findings"],
"pageStart": 1, "pageEnd": 2,
"charStart": 686, "charEnd": 1364,
"chunkIndex": 1, "chunkCount": 13, "tokensEstimate": 170
}
],
"warnings": [],
"processingMs": 13
}

Chunk layout (outputMode: "chunks"): each row is { "id": "f26767130f-2", "text": "...", "metadata": { source, title, author, language, format, headingPath, chunkIndex, chunkCount, pageStart, pageEnd, charStart, charEnd, tokensEstimate } }.

A failed document produces { "status": "error", "source": {...}, "error": "HTTP 404 Not Found" }. A SUMMARY record in the key-value store gives totals.

Pricing

Pay per event. You pay for converted documents, not for compute time.

EventPriceWhen it is charged
Document converted$0.004 per documentOnce per successfully converted document
10 extra pages$0.002 per blockOnce per started block of 10 pages after the first 10 pages of a document

Examples: a web page or a 10-page PDF costs $0.004, a 50-page PDF $0.012, a 200-page PDF $0.042. Failed, empty or oversized documents are free. Set a maximum cost per run and the Actor stops cleanly when it is reached.

Limitations (read before you rely on it)

  • No OCR. Scanned PDFs (images of text) return a warning and no text. OCR engines need several hundred MB of memory and language data downloaded at run time, which would make runs slower and pricier for everyone; it may be added as a separate paid option.
  • Tables are detected by column alignment. Simple tables are reliable; merged cells, nested tables and tables drawn as images are not. Table rows are not merged across pages.
  • Multi-column PDF layouts (newspapers, two-column papers) are read line by line across columns, which can interleave text. Single-column documents work best.
  • Headings in PDFs are inferred from larger font sizes. A PDF whose headings have the same size as the body text, only bold, will not get # headings.
  • DOCX page count comes from the document properties when present, otherwise it is estimated (about 3,000 characters per page); HTML page count is always an estimate (pagesEstimated: true). Billing for extra pages uses these values.
  • Images are dropped (no captions or alt-text extraction for DOCX and PDF).
  • HTML pages that render with JavaScript are not executed: only the HTML returned by the server is converted. Use a browser-based scraper first if needed.
  • Formats: PDF, DOCX, HTML. Legacy .doc, .pptx, .xlsx are not supported.
  • Only public URLs or Apify storage are read; the Actor cannot log in to sites.

Use cases

Feed a knowledge base or RAG pipeline; prepare contracts, reports and papers for LLM summarisation; archive web articles as Markdown; normalise a mixed pile of PDFs and Word files before indexing.

Call it from code

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('YOUR_USERNAME/document-to-markdown-converter').call({
urls: ['https://example.com/report.pdf'],
outputMode: 'chunks',
chunkSize: 1200,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();

Privacy

Documents are processed inside the Actor run and are not sent to any third-party service. Results stay in your Apify storage under your retention settings.

Support

Found a document that converts badly? Open an issue on the Actor's Issues tab with the (non-confidential) file or URL and the expected result.

FAQ

Does it do OCR on scanned PDFs? No. It reads the text layer of a PDF. A scanned PDF without a text layer needs an OCR step first (see the OCR Text Extractor in the list below).

Can I convert files I uploaded? Yes. Upload files to a key-value store and give their keys and the store ID or name in the input.

What are chunks for? With chunking on, each document is cut along headings and paragraphs into overlapping pieces that carry their heading path, ready for embeddings and RAG.

Are failed documents charged? No. A failed document returns an item with status "error" and is free.

More Actors by clearcheck