| name | markitdown |
| description | Use MarkItDown to convert various files to Markdown. Use when converting PDF, Word, PowerPoint, Excel, images, audio, HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs, Jupyter notebooks, RSS feeds, or Wikipedia pages to Markdown format. Also use for document processing pipelines, LLM preprocessing, or text extraction tasks. |
| disable-model-invocation | true |
MarkItDown Skill
Microsoft's Python utility for converting various file formats to Markdown
for LLM and text analysis pipelines.
Overview
MarkItDown converts documents while preserving structure (headings, lists,
tables, links). It's optimized for LLM consumption rather than
human-readable output.
Supported Formats
| Category | Formats |
|---|
| Documents | PDF, Word (DOCX), PowerPoint (PPTX), Excel (XLSX, XLS) |
| Media | Images (EXIF + OCR), Audio (WAV, MP3 transcription) |
| Web | HTML, YouTube URLs, Wikipedia, RSS/Atom feeds |
| Data | CSV, JSON, XML, Jupyter notebooks (.ipynb) |
| Archives | ZIP (iterates contents), EPub |
| Email | Outlook MSG files |
Quick Start
Installation
uv tool install 'markitdown[all]'
uv tool install 'markitdown[pdf,docx,pptx]'
uvx --from 'markitdown[all]' markitdown document.pdf
uv add 'markitdown[all]'
Optional Dependencies
| Extra | Description |
|---|
[all] | All optional dependencies |
[pdf] | PDF file support |
[docx] | Word documents |
[pptx] | PowerPoint presentations |
[xlsx] | Excel spreadsheets |
[xls] | Legacy Excel files |
[outlook] | Outlook MSG files |
[az-doc-intel] | Azure Document Intelligence |
[audio-transcription] | WAV/MP3 transcription |
[youtube-transcription] | YouTube video transcripts |
Command-Line Usage
markitdown document.pdf > output.md
markitdown document.pdf -o output.md
cat document.pdf | markitdown > output.md
markitdown document.pdf -o output.md -d -e "<endpoint>"
Python API
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("document.xlsx")
print(result.text_content)
from openai import OpenAI
client = OpenAI()
md = MarkItDown(
llm_client=client,
llm_model="gpt-4o",
llm_prompt="Describe this image in detail"
)
result = md.convert("image.jpg")
print(result.text_content)
md = MarkItDown(docintel_endpoint="<your-endpoint>")
result = md.convert("complex-document.pdf")
print(result.text_content)
Common Use Cases
Batch Convert Directory
from markitdown import MarkItDown
from pathlib import Path
md = MarkItDown()
input_dir = Path("./documents")
output_dir = Path("./markdown")
output_dir.mkdir(exist_ok=True)
for file in input_dir.glob("*"):
if file.is_file():
try:
result = md.convert(str(file))
output_file = output_dir / f"{file.stem}.md"
output_file.write_text(result.text_content)
print(f"Converted: {file.name}")
except Exception as e:
print(f"Failed: {file.name} - {e}")
Process for LLM Context
from markitdown import MarkItDown
def prepare_for_llm(file_path: str) -> str:
"""Convert document to LLM-ready markdown."""
md = MarkItDown()
result = md.convert(file_path)
content = f"# Source: {file_path}\n\n{result.text_content}"
return content
context = prepare_for_llm("report.pdf")
Extract YouTube Transcript
markitdown "https://www.youtube.com/watch?v=VIDEO_ID" > transcript.md
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("https://www.youtube.com/watch?v=VIDEO_ID")
print(result.text_content)
Image OCR with AI Description
from markitdown import MarkItDown
from openai import OpenAI
client = OpenAI()
md = MarkItDown(
llm_client=client,
llm_model="gpt-4o"
)
result = md.convert("screenshot.png")
print(result.text_content)
Convert Jupyter Notebook
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("analysis.ipynb")
print(result.text_content)
Extract Wikipedia Content
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("https://en.wikipedia.org/wiki/Python")
print(result.text_content)
Parse RSS Feed
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("https://example.com/feed.xml")
print(result.text_content)
Plugin System
MarkItDown supports third-party plugins for extended functionality.
markitdown --list-plugins
markitdown --use-plugins document.pdf
md = MarkItDown(enable_plugins=True)
result = md.convert("document.pdf")
Search GitHub for #markitdown-plugin to find available plugins.
MCP Server Integration
MarkItDown offers an MCP (Model Context Protocol) server for integration
with LLM applications like Claude Desktop.
uv tool install markitdown-mcp
uvx markitdown-mcp
git clone https://github.com/microsoft/markitdown.git
uv tool install --editable ./markitdown/packages/markitdown-mcp
See markitdown-mcp for configuration details.
Docker Usage
docker build -t markitdown:latest .
docker run --rm -i markitdown:latest < document.pdf > output.md
Troubleshooting
| Issue | Solution |
|---|
| Missing dependencies | Install with uv tool install 'markitdown[all]' |
| PDF extraction fails | Try Azure Document Intelligence for complex PDFs |
| Image text not extracted | Ensure OCR dependencies installed or use LLM mode |
| Large file timeout | Process in chunks or use streaming |
| Plugin not found | Run markitdown --list-plugins to verify installation |
Common Errors
uv tool install --reinstall 'markitdown[all]'
export AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT="<endpoint>"
export AZURE_DOCUMENT_INTELLIGENCE_KEY="<key>"
Requirements
- Python >= 3.10 (uv will fetch a managed interpreter automatically if missing)
uv tool install 'markitdown[all]'
uv init my-project && cd my-project
uv add 'markitdown[all]'
References