Use MarkItDown to extract Markdown from documents; use Pandoc when you need to convert between document formats. Both can turn a Word document into Markdown. Your next step—indexing the text, editing a manual, or exporting another document—helps decide which to try first.
Compare the task before the tools
| Your task | Start with |
|---|---|
| Extract Markdown from a mix of Office files and PDFs | MarkItDown |
| Convert DOCX to Markdown, then Markdown to DOCX or HTML | Pandoc |
| Convert a PDF | MarkItDown supports PDF input; Pandoc does not read PDFs |
Microsoft's MarkItDown README describes a Python converter aimed at text analysis, with format-specific installation extras. An LLM is not required for the DOCX conversion below. Treat its output as extracted content to review, rather than a reproduction of the page layout.
The Pandoc manual documents separate input readers and output writers. Choose both explicitly when a filename alone leaves room for confusion. Pandoc preserves document structure where possible, but conversions can lose formatting or complex elements. Writing a PDF through a PDF engine is different from reading a PDF: Pandoc does not provide a PDF input reader.
Try the same Word document in both
Choose a small .docx file you can inspect easily. Save a copy as sample.docx in an empty working folder. Include a heading, two paragraphs, a short list, and a simple table. Keep this first check separate from a large migration.
MarkItDown setup and conversion
With a supported Python version installed (3.10 or later; see the current project requirements), create a virtual environment. On macOS or Linux:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install 'markitdown[docx]'
markitdown sample.docx -o markitdown-output.mdOn Windows, create the environment with py -m venv .venv, then activate it in PowerShell with .\.venv\Scripts\Activate.ps1. If script execution is restricted, use .\.venv\Scripts\python.exe -m pip install "markitdown[docx]" and .\.venv\Scripts\markitdown.exe sample.docx -o markitdown-output.md directly instead of changing system policy. The docx extra supplies the dependencies for this example; other input formats may need other extras.
Pandoc setup and conversion
Install Pandoc using the official instructions for your operating system. It is a separate executable. Check that your terminal can find it:
pandoc --version
pandoc sample.docx --from=docx --to=gfm -o pandoc-output.mdHere gfm selects GitHub-flavored Markdown. To turn the reviewed Markdown into a Word document:
pandoc pandoc-output.md --from=gfm --to=docx -o reviewed.docxWhat our small DOCX check showed
On 24 October 2026, we ran the commands above on macOS with MarkItDown 0.1.9 and Pandoc 3.9, using one synthetic DOCX containing a heading, two paragraphs, two list items and a two-column table. Both outputs retained those text elements. In this sample, MarkItDown inserted an empty Markdown header row above the table labels; Pandoc used the labels as the header. The Pandoc round trip retained the table labels, values and list text in the resulting DOCX.
That is one structure check, not a benchmark or a promise about your files. Pay particular attention to table headers when reviewing your own output. We also checked Pandoc’s listed input formats: PDF was absent.
Inspect the output before converting a folder
Open both Markdown files beside the original. Check these four things:
- Is the heading still a heading?
- Does the list retain every item in order?
- Does each table value remain beside the correct label?
- Are any paragraphs missing, duplicated, or joined together?
Then open reviewed.docx. A successful command only proves that a file was produced; this inspection checks whether it is useful for your task. Repeat with one representative difficult document before committing a whole folder to either workflow. This small exercise is a starting check, not a speed or accuracy benchmark.
For a PDF-heavy workflow, our PDF converter comparison covers a different choice: extraction tools for different kinds of PDFs. Once you have output, use the Markdown cleanup checklist before publishing or indexing it.
Want to start with a PDF in your browser?
Convert a PDF to Markdown with pdf2md.pro, then check the result against your original. We maintain pdf2md.pro; this guide also includes command-line options so you can choose the workflow that fits.
