Install
openclaw skills install @lanyasheng/ms-markitdownConvert various document formats (PDF, Word, PowerPoint, Excel, images, audio, HTML, etc.) to Markdown using Microsoft's markitdown tool. Supports OCR, audio transcription, and YouTube video extraction.
openclaw skills install @lanyasheng/ms-markitdownMicrosoft's lightweight Python utility for converting various files to Markdown for use with LLMs and related text analysis pipelines.
pipx install 'markitdown[all]'
pip install 'markitdown[all]'
pip install 'markitdown[pdf,docx,pptx]'
| Format | Extension | Notes |
|---|---|---|
| Preserves structure, tables, links | ||
| Word | .docx | Headings, lists, tables |
| PowerPoint | .pptx | Slides to Markdown |
| Excel | .xlsx, .xls | Table data |
| Images | .png, .jpg, etc. | EXIF metadata + OCR |
| Audio | .wav, .mp3 | Speech transcription |
| HTML | .html, .htm | Web content |
| YouTube | URL | Video transcription |
| ZIP | .zip | Iterates over contents |
| EPub | .epub | E-books |
| Text | .csv, .json, .xml | Text-based formats |
# PDF to Markdown
markitdown document.pdf > output.md
# Word to Markdown
markitdown document.docx -o output.md
# PowerPoint to Markdown
markitdown presentation.pptx -o output.md
cat document.pdf | markitdown
markitdown screenshot.png -o text.md
markitdown "https://youtube.com/watch?v=..." -o transcript.md
from markitdown import MarkItDown
# Initialize
md = MarkItDown()
# Convert file
result = md.convert("document.pdf")
print(result.text_content)
# Convert from stream
with open("document.pdf", "rb") as f:
result = md.convert_stream(f)
print(result.text_content)
| Option | Description | Example |
|---|---|---|
-o, --output | Output file | -o output.md |
--format | Output format (default: markdown) | --format json |
--pages | Specific pages | --pages "1,3,5-7" |
--image-output | Image handling | --image-output external |
--quiet | Suppress output | --quiet |
MarkItDown provides an MCP (Model Context Protocol) server for integration with LLM applications:
pip install markitdown-mcp
Install Java 11+:
# macOS
brew install openjdk@17
# Ubuntu
sudo apt install openjdk-17-jdk
Use pipx or virtual environment:
python3 -m venv ~/.venvs/markitdown
source ~/.venvs/markitdown/bin/activate
pip install 'markitdown[all]'