MarkItDown
MarkItDown is a lightweight Python utility that converts PDFs, Office documents, images, audio, HTML, text-based formats, ZIP files, YouTube URLs, and EPubs to Markdown for LLMs and text analysis pipelines.
Visit microsoft/markitdownOverview
MarkItDown is a lightweight Python utility for converting various files to Markdown for use with LLMs and related text analysis pipelines. It focuses on preserving important document structure and content as Markdown, including headings, lists, tables, and links. The output is intended for text analysis tools rather than high-fidelity human-facing document conversion.
Key Features
- Supports conversion from PDF, PowerPoint, Word, Excel, images, audio, HTML, text-based formats such as CSV, JSON, and XML, ZIP files, YouTube URLs, and EPubs.
- Preserves important document structure and content as Markdown, including headings, lists, tables, and links.
- Provides a command-line interface and Python API, with optional format-specific dependencies.
- Supports third-party plugins, which are disabled by default, for extending conversion capabilities.
- Offers optional Azure Content Understanding and Azure Document Intelligence integrations for higher-quality cloud conversion and structured field extraction.
- Can use LLMs for image descriptions in PPTX and image files.
Use Cases
- Preparing documents and media as Markdown for LLM-based text analysis and RAG workflows.
- Converting office documents, PDFs, and web content into structured text.
- Extracting text and metadata from images, audio, and other supported formats for downstream analysis.
- Integrating document conversion into Python applications or command-line workflows.
Getting Started
- Requires Python 3.10 through 3.14; using a virtual environment is recommended.
- Install with pip install 'markitdown[all]', or install format-specific extras such as pdf, docx, and pptx.
- Convert a file from the command line with markitdown path-to-file.pdf, optionally using -o to specify an output file, or pipe content into markitdown.
- Use the Python API by creating MarkItDown, calling convert on a file, and printing result.markdown.
Deployment & Requirements
- Python 3.10 through 3.14 is required.
- Docker deployment is supported by building an image and running the container with input redirected.
- Optional Azure Document Intelligence conversion requires an endpoint and credentials, using AZURE_API_KEY or DefaultAzureCredential.
- Optional Azure Content Understanding conversion requires a Content Understanding endpoint.
Before You Adopt
- License: MIT. Review its terms before using, modifying, or distributing the project.
- It performs I/O with the current process's privileges and can access resources that process can access, so untrusted inputs should be sanitized.
- Third-party plugin support is available but disabled by default; enable it explicitly to use plugins.
- Document Intelligence analysis add-ons are not enabled by default and must be opted into explicitly.