Word to Markdown for LlamaIndex — Structured Document Ingestion
LlamaIndex's DocxReader extracts text from .docx files; the structure that gave the document meaning gets flattened in the process. Pre-convert to Markdown, parse with <code>MarkdownNodeParser</code>, and each section becomes a discrete node — heading hierarchy preserved, metadata pre-populated, retrieval naturally scoped to sections that actually mean something.
Why MarkdownNodeParser is the right primitive for Word content
LlamaIndex thinks in nodes — discrete units of content with metadata that flow through index, retrieve, and synthesise. MarkdownNodeParser is purpose-built to turn structured Markdown into well-formed nodes: each heading boundary creates a new node, the heading path lives in metadata, and downstream retrieval respects the document's real shape.
Convert each Word document on Word to Markdown, persist the .md, then load and parse with the standard LlamaIndex stack. Hand-correct any conversion errors in the .md before parsing — the corrected version persists, and every subsequent index rebuild benefits.
Multi-source corpus pattern
For knowledge bases that mix Word policies, PDF contracts, web reference docs, and audio meeting notes: convert each modality to Markdown (Word here, PDFs via PDF for LlamaIndex, URLs via URL for LlamaIndex, audio via Audio for LlamaIndex), then run the same MarkdownNodeParser pipeline across all of them. Source-modality metadata (e.g. type: contract vs type: meeting-notes) becomes a retrieval filter.
Code example
# LlamaIndex pipeline on the .md you downloaded from mdisbetter.com.
# Install: pip install llama-index-core
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
from llama_index.core.node_parser import MarkdownNodeParser
# 1. Load the converted Word documents from a directory
docs = SimpleDirectoryReader(
input_dir="./policies-md",
required_exts=[".md"],
).load_data()
# 2. Parse with MarkdownNodeParser — each ## becomes a node
parser = MarkdownNodeParser()
nodes = parser.get_nodes_from_documents(docs)
# Each node carries heading hierarchy in metadata.
# Build the index, query naturally.
index = VectorStoreIndex(nodes)
query_engine = index.as_query_engine()
print(query_engine.query("What does our data retention policy say about backups?"))
Frequently asked questions
Why MarkdownNodeParser over DocxReader for Word content?
DocxReader extracts text but flattens heading structure — every section becomes one big node, retrieval surfaces large irrelevant chunks. MarkdownNodeParser respects heading boundaries — each section becomes its own node with the heading path in metadata. Pre-converting to Markdown is the cost of admission for the cleaner parser.
Can I preserve nested heading hierarchy through to retrieval?
Yes — MarkdownNodeParser tracks the full heading path. A node nested under ## 4. Termination > ### 4.2 For Cause gets both heading levels in metadata. Retrieval can scope to specific paths, and synthesis prompts inherit the structural context for free.
How does this combine with LlamaIndex's composable indexes?
Cleanly. Each Word-derived document becomes a tree of section-level nodes. Multiple documents combine into a single index or layered indexes (per-document summary index over per-section detail index). Composable indexes work best when the underlying nodes have meaningful boundaries — which Markdown preserves and DocxReader does not.
What about hybrid retrieval (BM25 + vector)?
Markdown-derived nodes work especially well with hybrid retrieval. Section headings become high-signal lexical features (BM25 scores phrase matches in headings); the body content carries semantic signal for vector retrieval. Pre-converting to Markdown makes hybrid retrieval more accurate than either DocxReader-derived nodes or naive character chunks.
Should I run the converter or batch-convert with Pandoc?
Web tool for ad-hoc and progressive use — upload a few Word documents, download the Markdown, drop into your input directory. For automated batch ingestion of thousands of files, run Pandoc locally (pandoc input.docx -o output.md) in a shell loop. Same Markdown output, different operational surfaces; the LlamaIndex pipeline is identical downstream.
Your AI doesn't read PDFs directly. It first has to extract the text, decode the layout, ignore the metadata — before it can even start answering. A Markdown file removes all of those steps. Your AI reads it instantly. So you get faster responses, more accurate results, and zero information lost along the way.
Size-wise, it's 100 to 500 times lighter for the same content. A 15 MB PDF becomes a 30 KB .md file. So your AI knowledge base can hold hundreds of documents instead of a handful.
MDisBetter brings 19 free tools together for that — documents, videos, audio, web pages and prompts.
How does it work?
Drop a PDF, a video, an audio file or a URL. MDisBetter extracts the content and gives you a clean Markdown file. So you can send it to your AI, add it to your project files, or store it in your knowledge base — without losing anything.
Frequently Asked Questions
How do I convert a PDF to Markdown for free?
Upload your PDF to MDisBetter, click Convert, and get structured Markdown in seconds. No signup, no installation — it works directly in your browser. The free plan includes 50 credits per month.
Why is Markdown better than PDF for AI?
Markdown reduces token usage by up to 95% compared to PDF. AI models like ChatGPT and Claude process Markdown far more efficiently because it contains only content structure — no fonts, no layout data, no binary overhead.
What file types can MDisBetter convert?
MDisBetter converts PDF, Word (.docx), plain text, YouTube videos (transcript), audio files (MP3, WAV, M4A, OGG, FLAC, WEBM), and any web page URL to clean Markdown.
Is MDisBetter free?
Yes, free to start. The free plan includes 50 credits per month. All processing happens securely — your files are never stored.
Can I extract a YouTube transcript as Markdown?
Yes. Paste the YouTube video URL, click Convert, and get the full transcript structured as Markdown with headings and timestamps. Perfect for feeding video content to AI tools.
PDF → Markdown
Faithful and structured conversion of your documents
Text to MD, EPUB to MD, MD to PDF, MD Cleaner, Merger, Chunker, Token Counter, Context Builder
Free
—
Word to MD
0.5 credit
per page
Excel to MD
0.5 credit
per conversion
Single URL Scrape
0.5 credit
per call
Site Crawl
1 credit
per page
Translate
1 credit
per 10 000 chars (min 1, free re-translation on cache hit)
Prompt Optimizer
1 credit
per call
System Prompt Generator
1 credit
per call
Audio to MD
2 credits
per minute
Video to MD
2 credits
per minute
YouTube to MD
2 credits
per minute
Image OCR
4 credits
per image (0 on cache hit)
PDF to MD
4 credits
per page
PPTX to MD
4 credits
per slide
Questions
Yes! You get 50 credits every month to use any tool. Basic tools like MD Cleaner or Token Counter cost just 0.5 credit per use. When you run out, credits reset the next month or you can upgrade for more.
Wait for your monthly reset or upgrade to a higher plan. Credits renew on your billing date each month.
Yes, cancel anytime with one click. No questions asked. You keep access until the end of your billing period.
Pro gives you 30,000 credits for $29 — that's 30x more credits than Starter for just 3x the price. Every credit costs less, so you get far more value per dollar.