# markitdown

> Python tool that turns PDFs, Office files, audio and more into Markdown for LLMs

- Repository: https://github.com/microsoft/markitdown
- Category: Memory, RAG & data
- Stars: 191,675 · Forks: 14,287 · Language: Python · License: MIT
- Experience: Beginner friendly
- Page: https://ir.adyog.com/repos/microsoft/markitdown/

LLMs and text-analysis tools work best with clean text, but real documents come as PDFs, slide decks, spreadsheets and scans. MarkItDown reads many of these formats and writes Markdown, which stays close to plain text while keeping structure like headings, lists, tables and links.

You can use it as a command-line tool or as a Python library. Each file type has its own converter, and extra dependencies are installed per format, so you only pull in what you need. If you pass in an OpenAI-compatible client, an LLM can describe images and read text from images embedded in documents. Third-party plugins can add more formats.

The README compares it to textract, but says it focuses on preserving document structure. The output is meant for machines to read, so it may not suit cases where a person needs a faithful copy of the original layout. For harder documents it can call paid Azure services (Document Intelligence or Content Understanding) instead of its offline converters.

## What it does

- **Many input formats**: Handles PDF, PowerPoint, Word, Excel, images (EXIF and OCR), audio (metadata and transcription), HTML, CSV, JSON, XML, ZIP, EPub and YouTube URLs.
- **CLI and Python API**: Run markitdown on a file, use -o for an output file, or pipe content in. In Python, call convert() and read result.markdown.
- **Optional extras per format**: Install only what you need, such as markitdown[pdf, docx, pptx], or use [all] for everything.
- **LLM image descriptions and OCR**: Pass an llm_client and llm_model to describe images in PowerPoint and image files. The markitdown-ocr plugin uses the same pattern to read text from images inside PDF, DOCX, PPTX and XLSX files.
- **Azure options and plugins**: Can use Azure Document Intelligence or Content Understanding for higher-quality, billable cloud conversion. Plugins are off by default and enabled with --use-plugins.

## What you could build

- Convert a folder of PDFs and Word files into Markdown before indexing them for a RAG system.
- Turn a PowerPoint deck or Excel sheet into text you can paste into an LLM prompt.
- Transcribe audio or pull a YouTube transcript into text for analysis.
- Describe images in slides or photos using a vision-capable model.
- Extract invoice fields into YAML front matter using an Azure Content Understanding analyzer.

## Who it's for

Developers and students building LLM or text-analysis pipelines who are comfortable with Python and the command line; sanitize inputs when handling untrusted files.

## Get started

Use Python 3.10 or newer, ideally in a virtual environment, and install with the [all] extra. Then run markitdown on a file and redirect the output to a .md file.

```
pip install 'markitdown[all]'
```
```
markitdown path-to-file.pdf > document.md
```

Tags: markdown, document-conversion, llm, pdf, rag
