MarkItDown¶
Important
MarkItDown performs I/O with the privileges of the current process. Like open() or
requests.get(), it will access resources that the process itself can access. Sanitize
your inputs in untrusted environments, and call the narrowest convert_* function needed
for your use case (e.g., convert_stream(), or convert_local()). See the
Security section for more information.
MarkItDown is a lightweight Python utility for converting various files to Markdown for use with LLMs and related text analysis pipelines. To this end, it is most comparable to textract, but with a focus on preserving important document structure and content as Markdown (including: headings, lists, tables, links, etc.) While the output is often reasonably presentable and human-friendly, it is meant to be consumed by text analysis tools — and may not be the best option for high-fidelity document conversions for human consumption.
Supported formats¶
MarkItDown currently supports the conversion from:
- PowerPoint
- Word
- Excel
- Images (EXIF metadata and OCR)
- Audio (EXIF metadata and speech transcription)
- HTML
- Text-based formats (CSV, JSON, XML)
- ZIP files (iterates over contents)
- YouTube URLs
- EPubs
- ... and more!
Why Markdown?¶
Markdown is extremely close to plain text, with minimal markup or formatting, but still provides a way to represent important document structure. Mainstream LLMs, such as OpenAI's GPT-4o, natively "speak" Markdown, and often incorporate Markdown into their responses unprompted. This suggests that they have been trained on vast amounts of Markdown-formatted text, and understand it well. As a side benefit, Markdown conventions are also highly token-efficient.
Next steps¶
-
Getting Started
Check the prerequisites and install MarkItDown.
-
Usage
Convert files from the command line, Python, or Docker.
-
Plugins
Extend MarkItDown with 3rd-party and OCR plugins.
-
Azure Integrations
Higher-quality conversion with Azure AI services.
Need documentation like this for your own product?
This site was built by Sonicar Tech LLC — we help SaaS, B2B, Enterprise, FinTech, and AI companies launch professional, docs-as-code documentation 60% faster and cheaper than building an in-house team, with first drafts delivered in 1 week.