PDF & Word (DOCX) to Markdown Converter for LLMs and RAG
Pricing
from $3.00 / 1,000 page converteds
PDF & Word (DOCX) to Markdown Converter for LLMs and RAG
Convert PDF and Word (.docx) files from URLs into clean Markdown for LLMs, RAG and summarising. Input: file URLs. Output: Markdown per document with headings, tables, page markers and optional chunks. $0.003 per page.
Pricing
from $3.00 / 1,000 page converteds
Rating
0.0
(0)
Developer
Chris Day
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
39 minutes ago
Last modified
Categories
Features
Share
PDF & DOCX to Markdown for AI/RAG
Turn links to PDF and Word (.docx) files into clean, structured Markdown that is ready for LLMs, vector databases and RAG pipelines. Optionally split each document into heading-aware chunks.
When an AI agent should use this
Use geeky_goth_gamer/pdf-docx-to-markdown when:
- You have a link to a PDF or Word (.docx) file and need its text as Markdown to read, summarise, quote or index.
- You are building RAG or search over reports, papers, contracts, manuals or policies (set
chunkSizefor ready-made chunks). - You need page numbers for citations (
includePageMarkers: true).
Don't use it for:
- HTML web pages (use a web page to Markdown Actor) or scanned PDFs that need OCR.
Example input:
{"urls": ["https://arxiv.org/pdf/1706.03762"],"chunkSize": 4000,"maxPagesPerDocument": 20}
Output: One dataset item per document: markdown, pageCount, title, warnings, optional chunks, and billablePages.
Cost: $0.003 per PDF page (20 pages = $0.06). Failed files are free.
Call it from an agent:
- Apify MCP server: add
https://mcp.apify.com/?tools=geeky_goth_gamer/pdf-docx-to-markdownto your MCP client; the tool isgeeky_goth_gamer--pdf-docx-to-markdown. Or usecall-actorwith"actor": "geeky_goth_gamer/pdf-docx-to-markdown". - Python:
ApifyClient(token).actor("geeky_goth_gamer/pdf-docx-to-markdown").call(run_input=...), then readclient.dataset(run["defaultDatasetId"]).list_items().items. - HTTP:
POST https://api.apify.com/v2/acts/geeky_goth_gamer~pdf-docx-to-markdown/run-sync-get-dataset-items?token=YOUR_TOKENwith the input JSON as the body.
What it does
- PDF → Markdown with real structure:
#headings worked out from font sizes and bold numbered sections, paragraphs re-joined across line breaks, hyphenated words rejoined, bullet lists, and ruled tables turned into Markdown tables. - Two-column layouts (research papers, reports) are read column by column, in the right order.
- Noise removal: running headers, footers, page numbers and rotated margin stamps (such as the arXiv sidebar) are dropped.
- DOCX → Markdown: headings, lists, tables, bold and italics, links, and image placeholders. The title comes from the document properties.
- RAG chunking (optional): chunks of up to N characters split at headings, then paragraphs, then sentences, with optional overlap. Each chunk carries its
headingPath(e.g.["3 Model Architecture", "3.2 Attention"]). - Safe by design: only public
http(s)links are fetched. Links to private, internal or cloud-metadata addresses are refused, every redirect is re-checked, and downloads are capped in size and time. Each document is converted in a separate memory-limited process, so one malformed file cannot crash the run.
Input
| Field | Default | Notes |
|---|---|---|
urls (required) | — | Public links to PDF or DOCX files. Up to 1,000 per run. Duplicates are removed. |
chunkSize | 0 | 0 = no chunks; otherwise 200–50,000 characters. |
chunkOverlap | 0 | Up to half of chunkSize. |
removeHeadersFooters | true | PDF only. |
detectTables | true | PDF only. |
includePageMarkers | false | PDF only. Adds <!-- page N --> so you can cite page numbers. |
includeImagePlaceholders | true | DOCX only. Image data is never included. |
maxPagesPerDocument | 500 | Only the first N pages are converted and billed (1–3,000). |
maxFileSizeMb | 50 | 1–200. Larger files are skipped and not billed. |
timeoutSecondsPerDocument | 300 | 10–1,800. |
Example:
{"urls": ["https://arxiv.org/pdf/1706.03762"],"chunkSize": 1500,"chunkOverlap": 100}
Invalid input stops the run straight away with a clear message (for example Invalid input: "chunkOverlap" must be at most half of "chunkSize"), and nothing is charged.
Output
One dataset item per link:
{"url": "https://arxiv.org/pdf/1706.03762","status": "ok","finalUrl": "https://arxiv.org/pdf/1706.03762","fileName": "1706.03762v7.pdf","fileType": "pdf","fileSizeBytes": 2215244,"pageCount": 15,"title": "Attention Is All You Need","markdown": "# Attention Is All You Need\n\n...","chunks": [{"index": 0, "text": "...", "headingPath": ["Abstract"]}],"characterCount": 39527,"wordCount": 6373,"warnings": ["921 rotated/vertical text fragment(s) (e.g. margin stamps) were skipped."],"billablePages": 15,"durationSeconds": 2.9}
Failed links produce {"url": ..., "status": "error", "error": "<plain-English reason>", "billablePages": 0} and are never charged.
Pricing
Pay per event. You pay only for pages successfully converted:
- Page converted: $0.003 per PDF page. DOCX files have no pages, so they are billed per 3,000 characters of output (at least one).
- Actor start: Apify's standard start fee ($0.00005 per run per GB of memory).
There is no per-document fee. Failed, empty, scanned-image-only and refused files are free. The Actor respects your maximum cost per run: it never converts more pages than your budget covers, and it stops cleanly when the budget runs out.
Examples: a 15-page paper costs about $0.045, and 1,000 ten-page reports cost about $30.
Limitations
- No OCR. Scanned PDFs (images of text) return a warning and are not billed.
- Complex forms (for example tax forms with many boxes) come out readable but untidy.
- Tables: only ruled tables are detected. Borderless tables come out as text.
- Rotated text (vertical margin labels) is skipped on purpose.
- Not supported: password-protected PDFs, legacy
.docfiles and other formats; these return a clear error. - The SSRF guard checks every address a link resolves to and every redirect. A hostile DNS server that changes its answer between the check and the connection (DNS rebinding) is a residual, documented risk, which is limited by the platform's network isolation.
Open-source components
pdfplumber and pdfminer.six (MIT), mammoth (BSD-2), markdownify (MIT), httpx (BSD-3), Apify SDK (Apache-2.0). No AGPL components.
Local development
python -m venv venv && . venv/bin/activate && pip install -r requirements.txt pytest reportlab python-docxpython -m pytest -p no:asyncio # SKIP_NETWORK=1 to skip tests that download real documentsapify run # uses storage/key_value_stores/default/INPUT.json