microsoft /
markitdown
Python tool that turns PDFs, Office files, audio and more into Markdown for LLMs
- 191.7k stars
- 3.8k stars since 3 Oct
- Python
- Updated today
- Beginner friendly
- Memory, RAG & data
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.
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.mdCommands are copied from the project's README. Read it on GitHub for the full setup.
Anything better than markitdown?
MarkItDown is the strongest general pick for turning mixed file types (Office, PDF, audio, HTML) into LLM-ready Markdown. Look elsewhere only if you need PDF layout accuracy with bounding boxes, or hard scanned-document OCR.
-
liteparseAlternative Pick it when PDFs are the main input and you need layout-aware text with bounding boxes for RAG or citations, running locally without an LLM. Trade-off: Narrower scope: no audio, HTML or YouTube-style inputs, and it is a much smaller, younger project.
-
Unlimited-OCRAlternative Pick it for scanned or image-heavy multi-page PDFs where plain text extraction fails and you can run a vision-language model. Trade-off: Needs GPU-style model serving and setup; far heavier than a simple converter and not a multi-format tool.
-
crawl4aiUse alongside Use both to cover files and the web: MarkItDown handles local documents, Crawl4AI crawls live pages in a browser into clean Markdown. Trade-off: Adds a second dependency with browser automation, which is heavier to run than MarkItDown.
More in Memory, RAG & data
vectorize-io/hindsight
Memory server that lets AI agents store, search and learn from past interactions