The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Markitdown listing page.
[!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(), orconvert_local()). See the Security Considerations section of the documentation 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.
MarkItDown currently supports the conversion from:
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.
MarkItDown requires Python 3.10 or higher. It is recommended to use a virtual environment to avoid dependency conflicts.
With the standard Python installation, you can create and activate a virtual environment using the following commands:
If using uv, you can create a virtual environment with:
If you are using Anaconda, you can create a virtual environment with:
To install MarkItDown, use pip: pip install 'markitdown[all]'. Alternatively, you can install it from the source:
Or use -o to specify the output file:
You can also pipe content:
MarkItDown has optional dependencies for activating various file formats. Earlier in this document, we installed all optional dependencies with the [all] option. However, you can also install them individually for more control. For example:
will install only the dependencies for PDF, DOCX, and PPTX files.
At the moment, the following optional dependencies are available:
[all] Installs all optional dependencies[pptx] Installs dependencies for PowerPoint files[docx] Installs dependencies for Word files[xlsx] Installs dependencies for Excel files[xls] Installs dependencies for older Excel files[pdf] Installs dependencies for PDF files[outlook] Installs dependencies for Outlook messages[az-doc-intel] Installs dependencies for Azure Document Intelligence[az-content-understanding] Installs dependencies for Azure Content Understanding[audio-transcription] Installs dependencies for audio transcription of wav and mp3 files[youtube-transcription] Installs dependencies for fetching YouTube video transcriptionMarkItDown also supports 3rd-party plugins. Plugins are disabled by default. To list installed plugins:
To enable plugins use:
To find available plugins, search GitHub for the hashtag #markitdown-plugin. To develop a plugin, see packages/markitdown-sample-plugin.
The markitdown-ocr plugin adds OCR support to PDF, DOCX, PPTX, and XLSX converters, extracting text from embedded images using LLM Vision — the same llm_client / llm_model pattern that MarkItDown already uses for image descriptions. No new ML libraries or binary dependencies required.
Installation:
Usage:
Pass the same llm_client and llm_model you would use for image descriptions:
If no llm_client is provided the plugin still loads, but OCR is silently skipped and the standard built-in converter is used instead.
See packages/markitdown-ocr/README.md for detailed documentation.
Azure Content Understanding provides higher-quality conversion with structured field extraction (YAML front matter), multi-modal support (documents, images, audio, video), and configurable analyzers.
Install: pip install 'markitdown[az-content-understanding]'
Content Understanding is ideal when you need capabilities beyond what built-in or Document Intelligence converters provide:
cu_endpoint handles documents, images, audio, and video with automatic analyzer routing.| Capability | Built-in converters | Azure Document Intelligence | Azure Content Understanding |
|---|---|---|---|
| Document conversion | Offline, format-specific extraction | Cloud layout extraction | Cloud multimodal extraction |
| Structured fields | Not available | Not exposed by this integration | YAML front matter from analyzer fields |
| Custom analyzers | Not available | Not configurable in this integration | Supported with cu_analyzer_id |
| Audio and video | Basic audio, no video | Not supported | Audio and video analyzers |
| Cost | Local compute only | Billable Azure API calls | Billable Azure API calls |
CLI:
The endpoint can also be set once in the environment, so callers only need --use-cu:
Python API:
With a custom analyzer (for domain-specific field extraction):
When cu_analyzer_id is set, the converter automatically scopes it to compatible file types based on the analyzer's modality. Incompatible types (e.g., audio files with a document analyzer) auto-route to default prebuilt analyzers.
Cost note: Each convert() call for a CU-routed format is a billable Azure API call. Use cu_file_types to restrict which formats route to CU:
More information about Azure Content Understanding can be found here.
To use Microsoft Document Intelligence for conversion:
The endpoint can also be set once in the environment, so callers only need -d:
More information about how to set up an Azure Document Intelligence Resource can be found here
Basic usage in Python:
Document Intelligence conversion in Python:
To use Large Language Models for image descriptions (currently only for pptx and image files), provide llm_client and llm_model:
Before starting significant work, please read What to Contribute, which describes what is in and out of scope for this repository.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
MarkItDown is a Python utility for converting files to Markdown for use with LLMs and related text analysis pipelines. This repository is intended to provide Python libraries that can be incorporated into other systems — not the end-user applications built on top of them.
markitdown command-line interfacemarkitdown-mcp packageWe cannot accept additional applications, services, or servers. This includes:
Projects like these are genuinely useful, and we would rather see them thrive than be turned away. If you are interested in providing a web service, API, or graphical application for MarkItDown, please maintain it as a separate package or project that depends on markitdown from PyPI.
MarkItDown supports 3rd-party plugins, so support for a new format can be published and installed independently of this repository:
See packages/markitdown-sample-plugin to get started, and tag your repository #markitdown-plugin so that others can find it.
You can help by looking at issues or helping review PRs. We have also marked some issues as 'open for contribution' and PRs as 'open for reviewing' to help facilitate community contributions. These labels are suggestions; contributions within the scope described above are welcome.
| All | Especially Needs Help from Community | |
|---|---|---|
| Issues | All Issues | Issues open for contribution |
| PRs | All PRs | PRs open for reviewing |
Navigate to the MarkItDown package:
Install hatch in your environment and run tests:
(Alternative) Use the Devcontainer which has all the dependencies installed:
Run pre-commit checks before submitting a PR: pre-commit run --all-files
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: Do not pass untrusted input directly to MarkItDown. If any part of the input may be controlled by an untrusted user or system, such as in hosted or server-side applications, it must be validated and restricted before calling MarkItDown. Depending on your environment, this may include restricting file paths, limiting URI schemes and network destinations, and blocking access to private, loopback, link-local, or metadata-service addresses.
Call only the conversion method you need: Prefer the narrowest conversion API that fits your use case. MarkItDown's convert() method is intentionally permissive and can handle local files, remote URIs, and byte streams. If your application only needs to read local files, call convert_local() instead. If you need more control over URI fetching, call requests.get() yourself and pass the response object to convert_response(). For maximum control, open a stream to the input you want converted and call convert_stream().
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.