MarkItDown converts many file types into Markdown for LLM and text analysis pipelines. It aims to preserve headings, lists, tables, and links rather than perfect human layout.
Overview
MarkItDown is a lightweight Python utility for converting various files to Markdown for use with LLMs and related text analysis pipelines. Compared to tools like textract, it emphasizes keeping document structure such as headings, lists, tables, and links in Markdown form, even though output is mainly intended for automated text tools rather than polished human-readable conversion.
Supported inputs include PDF, PowerPoint, Word, Excel, images with metadata or captioning, audio with metadata or transcription, HTML, CSV, JSON, XML, ZIP archives, YouTube URLs, and EPubs. Optional extras add format-specific dependencies, Azure Document Intelligence, Azure Content Understanding, audio or YouTube transcription, and third-party plugins tagged on GitHub.
A command-line markitdown interface accepts files, output paths, and piped content. Python APIs expose convert helpers, with optional Azure credentials, document models, and LLM clients for image descriptions or OCR plugins. Image captioning and some transcription paths rely on web-hosted services.
Conversion runs with the privileges of the host process, so callers should sanitize inputs and choose narrow convert functions in untrusted settings. Docker can be used to run the tool in isolated environments.
Key features
- Multi-format file to Markdown conversion
- Command-line and Python APIs
- Optional Azure document services
- Plugin system for extra formats
- Structure-preserving Markdown output
- LLM-based image description hooks
- Optional OCR plugin for embedded images
- Granular optional dependency installs
Use cases
- Preparing documents for LLM ingestion
- Normalizing office files to text pipelines
- Batch converting mixed media archives
- Extracting structured fields via Azure options