Built from the official docs: GitHub - microsoft/markitdown: Python tool for converting files and office documents to Markdown. · raw.githubusercontent.com · checked 25 November 2026
Command-line with pip
Check your Python version
MarkItDown requires Python 3.10 through 3.14. Confirm you have a supported version before continuing.
python --versionCreate and activate a virtual environment
The README recommends using a virtual environment to avoid dependency conflicts. These commands create and activate one with the standard Python installation.
python -m venv .venv source .venv/bin/activateInstall MarkItDown with all optional dependencies
Install the package with pip. The [all] option installs all optional dependencies so every supported file format works.
pip install 'markitdown[all]'Convert a file from the command line
Run the markitdown command on your file and write the Markdown to an output file. Replace the placeholders with your own file paths.
markitdown <path-to-your-file.pdf> -o <output.md>(Optional) Use it from Python instead
You can also call MarkItDown from Python. Create a MarkItDown instance, convert your file, and print the Markdown.
from markitdown import MarkItDown md = MarkItDown(enable_plugins=False) # Set to True to enable plugins result = md.convert("<path-to-your-file>") print(result.markdown)
Check it worked
The output file (or the printed result.markdown) contains your document converted to Markdown, preserving structure such as headings, lists, tables, and links.