If you need to convert PDF Word and Excel to Markdown for an AI workflow, MarkItDown gives you a simple local route. It is a Python tool from Microsoft that turns office documents and other files into Markdown text that language models and text analysis tools can read more easily. This tutorial shows the basic install, the first conversions, and the quality checks to run before you paste the result into an AI tool.
Markdown is useful here because it keeps meaning-bearing structure without heavy formatting. Headings, lists, tables, and links can survive as readable text, while the file stays close to plain text. That makes the output practical for summarizing, searching, indexing, and preparing source material for coding agents.
What MarkItDown does
MarkItDown converts files into Markdown for use with large language models and related text pipelines. The official project describes it as a lightweight Python utility, and its focus is preserving important document structure rather than recreating a page layout exactly. That distinction matters: the result is meant to be consumed by text tools, and it may not be the best choice when you need a high-fidelity document for human presentation.
For creators and beginners, the value is practical. A research PDF, a Word draft, or an Excel table often contains the facts you want an AI assistant to use, but the original file is awkward to paste into a prompt. Converting it first gives you a clean text version that you can review, trim, and reuse.
Which files can you convert?
The current official documentation lists support for PDF, PowerPoint, Word, Excel, images, audio, HTML, CSV, JSON, XML, ZIP files, YouTube URLs, and EPUB files. Image handling can include metadata and captioning, while audio handling can include metadata and speech transcription. Some of those features rely on web-hosted services, so a fully local workflow should use only the optional parts you actually need.
| Input | Typical use in an AI workflow |
|---|---|
| Turn reports, guides, and research papers into readable text | |
| Word (.docx) | Prepare drafts and documents for summarization or rewriting |
| Excel (.xlsx, .xls) | Turn spreadsheet content into Markdown tables for analysis |
| PowerPoint | Extract slide content for notes, scripts, or summaries |
| HTML, CSV, JSON, XML | Normalize web and data files into a consistent text format |
Before you start
MarkItDown requires Python 3.10 through 3.14. The documentation recommends a virtual environment so the package dependencies do not conflict with other Python projects on your computer. Create the environment first, then install MarkItDown inside it.
python -m venv .venv source .venv/bin/activate On Windows, activation commands differ by shell, so use the activation step that matches your terminal. The important point is to install and run the tool inside the same environment.
Step 1: Install MarkItDown
For a first test, install the full set of optional dependencies:
pip install 'markitdown[all]' If you only need a few formats, install a narrower set instead. For example, the documentation shows a selective install for PDF, Word, and PowerPoint:
pip install 'markitdown[pdf, docx, pptx]' Selective installs are a good habit for local-only work. They reduce what you add to the environment and make it clearer which converters you intended to enable. Available extras include options for Word, Excel, older Excel files, PDF, PowerPoint, Outlook messages, audio transcription, YouTube transcription, and Azure services.
Step 2: Convert your first PDF
The command-line usage is short. To save Markdown into a file, run:
markitdown path-to-file.pdf -o document.md You can also send the output to a file with redirection:
markitdown path-to-file.pdf > document.md Replace path-to-file.pdf with the real path to your PDF and document.md with the output name you want. After the command finishes, open the Markdown file and read the first pages before using it anywhere else.
Step 3: Convert PDF Word and Excel to Markdown
The same pattern works for Word and Excel files. Convert a Word document like this:
markitdown report.docx -o report.md Convert an Excel workbook like this:
markitdown data.xlsx -o data.md Use clear output names so you can tell which Markdown file came from which source. If you prepare documents for a coding agent, keep the Markdown files in the project folder with names that describe the source, such as product-notes.md or research-summary.md. A clean folder makes the next step easier, especially when you later ask an agent to read the files. For that agent step, see our guide on how to use OpenCode as a free coding agent.
Step 4: Check the output quality
Conversion is only the middle of the workflow. The useful part is checking whether the Markdown still represents the source well enough for your task.
Check these points:
- Headings appear in a sensible order.
- Lists are still readable as lists.
- Tables keep the rows and columns you need.
- Links are present where the source had useful links.
- Numbers, names, and dates match the original file.
- Missing pages or broken sections are noted before you rely on the text.
If a table is central to your task, compare it directly with the spreadsheet or PDF. MarkItDown aims to preserve structure, but complex layouts can still need manual cleanup. Treat the Markdown as a working draft of the source text, not as a perfect replica.
Step 5: Use MarkItDown in Python
If you are building a small script or pipeline, the Python API follows the same idea:
from markitdown import MarkItDown md = MarkItDown(enable_plugins=False) result = md.convert("test.xlsx") print(result.markdown) Plugins are disabled by default in this pattern. The command-line tool can list installed plugins and enable them explicitly when needed, but beginners should keep plugins off until they understand which plugin they are adding and why.
Limits and safety notes
MarkItDown runs with the file and network access of the current process. The official security notes advise sanitizing inputs in untrusted environments and using the narrowest conversion method that fits the job. In plain terms, do not feed unknown files from untrusted sources into an automated pipeline without checks.
Also remember the cost boundary. Built-in conversion uses local compute, while Azure Document Intelligence and Azure Content Understanding are cloud options with billable API calls. For a beginner tutorial workflow, start with the built-in converters and only consider cloud options when local output is not good enough for a specific document.
Finally, converting a document does not change who owns the original content. Only convert and reuse material that you have the right to process, and do not republish someone else's document just because the format changed.
FAQ
Is MarkItDown free to use?
MarkItDown is an open-source project released under the MIT License. Optional cloud services connected to some workflows can be billable, but the core local conversion route is the free starting point described in the documentation.
Do I need Python to use MarkItDown?
Yes. MarkItDown is a Python utility, and the documentation requires Python 3.10 through 3.14. A virtual environment is recommended before installation.
Can MarkItDown convert Excel files to Markdown tables?
Yes. Excel is listed among the supported formats, and the Python example in the documentation converts an .xlsx file. Always compare important tables with the original workbook after conversion.
Is the Markdown output ready to publish as a document?
Not always. The output is designed for text analysis and AI workflows, and it may not be the best option for high-fidelity human documents. Review and clean the text before publishing or sharing it.
Should I install all optional dependencies?
Install all dependencies for a broad first test, or install only the formats you need for a tighter local setup. Selective installation is useful when you want a smaller, clearer environment.
Sources
- Official MarkItDown repository by Microsoft: https://github.com/microsoft/markitdown
Next step
Start with one PDF, one Word file, and one Excel file that you already use. Convert each one, check the Markdown against the original, and keep only the clean text that helps your AI workflow. Then read our OpenCode guide to see how prepared Markdown files can support a coding-agent workflow: https://dikzma.blogspot.com/2026/12/how-to-use-opencode-free-coding-agent.html
Originally published on Dikzma: https://dikzma.blogspot.com/2026/12/markitdown-tutorial-convert-pdf-word-excel-to-markdown.html