
MarkItDown
github.com/microsoft/markitdown- Category
- Developer Tools
- Rank
- No. 08Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- @microsoft
- GitHub
- 180.8k stars
- Latest release
- v0.1.8b1
- Date
About
A Python utility that converts various file formats (PDFs, Office documents, images, audio, HTML, etc.) into clean Markdown text optimized for AI and text analysis pipelines. Preserves document structure while making content easily consumable by LLMs.
What it does
MarkItDown turns documents into Markdown, but it is mostly a dispatch layer rather than a parser: it detects what a byte stream actually is, picks the right registered handler, and delegates the real work to an established third-party library for Word, PDF, PowerPoint, Excel and Outlook material. The PDF path is the exception, carrying substantial home-grown table logic. The same engine ships three ways: a command-line tool, an importable Python class, and a separate MCP server exposing a single conversion tool.
Why it's ranked here
Nearly every document ingestion pipeline needs something unglamorous sitting in front of it, and this fills that slot under an MIT license with a Microsoft copyright. The base install is light, six runtime dependencies, with every format library behind an optional extra, and the XML-hardening dependency sits in the base set rather than behind an extra. Maintenance signals are structural rather than promotional: type checking configured, test directories in all four packages, a pre-commit setup checked in. Shipping as a library, a CLI and an MCP server means it fits pipelines that were not designed around it.
What's good
The extension point is small and precisely documented: a converter implements exactly two methods, and the written contract spells out the non-obvious rule that a handler which peeks at bytes must rewind the stream before returning. Optional formats fail helpfully: an unconfigured format raises a message naming the exact extra to install instead of breaking at import time. The HTML path catches a recursion failure in its Markdown generator and falls back to an iterative text extraction. The bundled MCP server binds only to the local machine by default and prints an explicit warning that it has no authentication when told to listen elsewhere.
Tradeoffs
Output fidelity is bounded by whatever library sits underneath, and the project's own documentation says plainly it may not be the best option for high-fidelity conversion meant for human reading. The image handler accepts only JPEG and PNG, and without a configured language model it emits nothing but photo metadata; that captioning routine also exists twice in the codebase. PDF form and table detection is a stack of positional heuristics with hard-coded tuning values whose behavior is hard to predict on an unfamiliar document. Plugin loading failures become warnings rather than errors, and the main class is still described as in preview.
How to use it well
Install only the format extras you need rather than everything, which pulls in fifteen further packages on top of the six base dependencies, including three Azure SDKs. Follow the project's security note and call the narrowest entry point, because a plain string that looks like a URL gets fetched with the current process's privileges. When feeding data through standard input, pass the extension, media-type or character-set hints so detection is not left entirely to content sniffing. Leave plugins off unless you need one; they are opt-in. If you route work to Azure Content Understanding, restrict which file types go there, since every routed conversion is a billable call.
Technical notes+
MarkItDown.__init__ in packages/markitdown/src/markitdown/_markitdown.py registers eighteen built-in converters into a priority-ordered list with two tiers, specific formats at 0.0 and near-catch-all handlers such as plain text, HTML and zip at 10.0, later registrations tried first. convert() branches on source type: strings beginning http:, https:, file: or data: go to convert_uri, other strings or Path objects to convert_local, a requests.Response to convert_response, anything exposing read() to convert_stream. Detection uses magika plus charset-normalizer, and results travel in the frozen StreamInfo dataclass in _stream_info.py. Every converter implements accepts() and convert() from _base_converter.py, and converters chain: _docx_converter.py subclasses the HTML converter and feeds mammoth's HTML output back through it. Underlying libraries: mammoth for Word, pdfminer.six and pdfplumber for PDF, python-pptx for PowerPoint, pandas with openpyxl or xlrd for Excel, olefile for Outlook messages. _pdf_converter.py carries positional heuristics with literal constants: 50-point column grouping, 40-point alignment tolerance, a 70th-percentile gap threshold clamped to 25 to 50, and a 20 percent table-row floor. _image_converter.py duplicates the LLM caption routine in _llm_caption.py, written to the OpenAI chat-completions shape. The MCP package exposes one tool, convert_to_markdown(uri), in packages/markitdown-mcp/src/markitdown_mcp/__main__.py. Stdin hint flags are -x, -m and -c; plugins load through the markitdown.plugin entry-point group.
Observed
- License
- MIT, Copyright Microsoft Corporation
- Interfaces
- Command-line tool, importable Python library, and a separate MCP server package
- Packaging
- Six base runtime dependencies; every format library sits behind an optional extra
- MCP server default binding
- Local machine only, with a printed warning that the server has no authentication on other interfaces
- Tests
- Per-package test directories present in the repository tree for all four packages
Read from README.md, LICENSE, packages/markitdown/pyproject.toml, packages/markitdown/src/markitdown/_markitdown.py, packages/markitdown/src/markitdown/_base_converter.py, packages/markitdown/src/markitdown/_stream_info.py, packages/markitdown/src/markitdown/_uri_utils.py, packages/markitdown/src/markitdown/__main__.py, packages/markitdown/src/markitdown/converters/__init__.py, packages/markitdown/src/markitdown/converters/_pdf_converter.py, packages/markitdown/src/markitdown/converters/_docx_converter.py, packages/markitdown/src/markitdown/converters/_html_converter.py, packages/markitdown/src/markitdown/converters/_image_converter.py, packages/markitdown/src/markitdown/converters/_llm_caption.py, packages/markitdown-mcp/src/markitdown_mcp/__main__.py.
What it can do
Convert PDF files to markdown
PDF file → Markdown text
Convert Office documents to markdown
Office document (Word, Excel, PowerPoint) → Markdown text
Convert images to markdown
Image file → Markdown text
Convert audio files to markdown
Audio file → Markdown text
Convert HTML documents to markdown
HTML file → Markdown text
Preserve document structure during conversion
Document with formatting and structure → Markdown with preserved structure
Optimize content for LLM consumption
Various file formats → LLM-optimized Markdown text
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.