Converts files and Office documents to LLM-friendly Markdown using Microsoft MarkItDown. Supports PDF, DOCX, PPTX, XLSX, images, audio, HTML, CSV, JSON, XML, ZIP, EPUB, MSG, Jupyter notebooks, and YouTube transcripts. No API key required for basic use.
Ships in alterlab-document-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
MarkItDown is Microsoft's Python package and CLI for converting documents, media, and web content to Markdown for LLM and text-analysis pipelines. It preserves structure that matters to models (headings, lists, tables, links) and is not meant for high-fidelity, human-facing document conversion. This skill targets markitdown 0.1.x (current release 0.1.8, Sept 2026; Python 3.10–3.14).
Use this skill when the user wants to:
markitdown-mcp server| Scenario | Use Instead |
|---|---|
| Ingesting many sources into a self-hosted notebook with chat, search, or podcasts | alterlab-open-notebook |
| Answering questions across the sections, figures, and tables of one PDF | alterlab-pdf-explore |
| Building a one-row-per-paper evidence table from many PDFs | alterlab-pdf-extract |
| Managing references, DOIs, or BibTeX libraries | alterlab-pyzotero |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-open-notebook) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
| Format | Description | Notes |
|---|---|---|
| Portable Document Format | Text-layer extraction ([pdf]); scans need OCR (see below) | |
| DOCX | Microsoft Word | Headings, lists, tables ([docx]) |
| PPTX | PowerPoint | Slide text, tables, notes; optional LLM image descriptions ([pptx]) |
| XLSX / XLS | Excel spreadsheets | One Markdown table per sheet ([xlsx], [xls]) |
| Images | JPEG, PNG | EXIF metadata (needs exiftool) and an LLM description when llm_client is set |
| Audio | WAV, MP3, M4A, MP4 | Metadata + speech transcription ([audio-transcription]) |
| HTML | Web pages | Clean conversion; Wikipedia and Bing result pages get dedicated handling |
| CSV / JSON / XML | Text-based data | CSV becomes a table; JSON, JSONL, and XML pass through as text; RSS/Atom feeds are parsed |
| ZIP | Archive files | Iterates contents |
| EPUB | E-books | Full text extraction |
| Outlook MSG | Email messages | Headers and body ([outlook]) |
| Jupyter | .ipynb notebooks | Markdown and code cells |
| YouTube | Video URLs | Fetches transcripts ([youtube-transcription]) |
# Install with all features (uv-first; uv pip works inside an active venv)
uv pip install 'markitdown[all]'
# Or run the CLI ad hoc without installing into the project env
uvx --from 'markitdown[all]' markitdown document.pdf -o output.md
# Or from source
git clone https://github.com/microsoft/markitdown.git
cd markitdown
uv pip install -e 'packages/markitdown[all]'
# Basic conversion
markitdown document.pdf > output.md
# Specify output file
markitdown document.pdf -o output.md
# Pipe content (give a type hint when reading from stdin)
cat document.pdf | markitdown -x pdf > output.md
# Keep embedded images as data URIs instead of truncating them
markitdown slides.pptx --keep-data-uris -o slides.md
# Plugins
markitdown --list-plugins # list installed plugins
markitdown --use-plugins document.pdf -o output.md
from markitdown import MarkItDown, StreamInfo
md = MarkItDown()
result = md.convert("document.pdf")
print(result.markdown) # result.text_content is a soft-deprecated alias
print(result.title) # may be None
# Local files only (narrower than convert(), which also fetches URIs)
result = md.convert_local("document.pdf")
# From a binary stream; stream_info replaces the deprecated file_extension= keyword
with open("document.pdf", "rb") as f:
result = md.convert_stream(f, stream_info=StreamInfo(extension=".pdf"))
Keyless (default). MarkItDown converts the text without any model; the images are pulled out so Claude can look at them with Read and write the descriptions itself:
uv run --python ">=3.10" --with 'markitdown[pptx,docx,pdf]' --with pymupdf python scripts/convert_with_ai.py \
slides.pptx slides.md --prompt-type data_viz
With no OPENROUTER_API_KEY this writes slides.md, the images to slides_images/
(slide02_img01.png, …; PDF images need PyMuPDF), and slides_images.json (slide or page
of each image plus the description prompt). Read every listed image, describe it with that
prompt (chart type, axes, every labelled value, the pattern), and insert the description
under the matching slide or page in slides.md. Report numbers only as they appear in the
image. --backend claude forces this path.
Optional: a vision model inside MarkItDown (needs OPENROUTER_API_KEY or an OpenAI key;
--backend openrouter exits 2 without it rather than skipping the descriptions). Built-in
support covers image files and pictures inside PPTX:
import os
from markitdown import MarkItDown
from openai import OpenAI
# OpenRouter takes the dotted slug of an Anthropic model ID (claude-opus-5-5 -> anthropic/claude-opus-5.5);
# scripts/convert_with_ai.py derives it from $ALTERLAB_MODEL (shared/model_env.md).
model = "anthropic/claude-opus-5.5"
# Initialize OpenRouter client (OpenAI-compatible API)
client = OpenAI(
api_key=os.environ["OPENROUTER_API_KEY"],
base_url="https://openrouter.ai/api/v1"
)
md = MarkItDown(
llm_client=client,
llm_model=model, # recommended for scientific vision
llm_prompt="Describe this image in detail for scientific documentation"
)
result = md.convert("presentation.pptx")
print(result.markdown)
MarkItDown has no local OCR engine; the converters read existing text layers. Keyless routes:
Claude reads a scanned page or image directly with Read and transcribes it (label by label,
marking anything illegible as [illegible]), and ocrmypdf adds a local Tesseract text layer
to scanned PDFs. Two optional, keyed routes add OCR inside MarkItDown:
markitdown-ocr plugin (Microsoft, 0.1.x): LLM-vision OCR for images inside PDF, DOCX, PPTX, and XLSX, with full-page OCR for scanned PDFs. It reuses the same llm_client / llm_model as image descriptions; without a client it silently falls back to the normal converters.
uv pip install markitdown-ocr openai
md_ocr = MarkItDown(enable_plugins=True, llm_client=client, llm_model=model) # client/model as above
result = md_ocr.convert("scanned_paper.pdf")
Azure Document Intelligence (cloud OCR and layout analysis) — see the next section.
For fully local OCR, add a text layer first (e.g. ocrmypdf scan.pdf searchable.pdf, which uses Tesseract) and then convert the result.
# Document Intelligence (endpoint on the command line or in MARKITDOWN_DOCINTEL_ENDPOINT)
markitdown document.pdf -o output.md -d -e "<document_intelligence_endpoint>"
# Content Understanding (documents, images, audio, video; needs the [az-content-understanding] extra)
markitdown recording.mp4 --use-cu --cu-endpoint "<content_understanding_endpoint>"
from markitdown import MarkItDown
md = MarkItDown(docintel_endpoint="<document_intelligence_endpoint>")
result = md.convert("complex_document.pdf")
print(result.markdown)
Authentication uses the AZURE_API_KEY environment variable if set, otherwise DefaultAzureCredential (Azure CLI login, managed identity, etc.); pass docintel_credential= to supply one explicitly. Both services send the document to Azure, so check that this is allowed for the data you are converting.
Plugins are disabled by default. Enable them with --use-plugins on the CLI or MarkItDown(enable_plugins=True) in Python. Find third-party plugins with the GitHub hashtag #markitdown-plugin; see references/api_reference.md for writing one.
markitdown-mcp (0.0.1 alpha series) exposes one tool, convert_to_markdown(uri), for http:, https:, file:, and data: URIs.
uv pip install markitdown-mcp
markitdown-mcp # STDIO transport (default)
markitdown-mcp --http --host 127.0.0.1 --port 3001 # Streamable HTTP + SSE on localhost
# Register with Claude Code
claude mcp add markitdown -- uvx markitdown-mcp
Set MARKITDOWN_ENABLE_PLUGINS=true in the server environment to use installed plugins. The server has no authentication and can read any file its user can, so keep it on localhost (upstream recommends the Docker image for Claude Desktop).
Control which file formats you support:
# Install specific formats (no spaces inside the bracket — pip parses 'pdf, docx' as bad names)
uv pip install 'markitdown[pdf,docx,pptx]'
# All available options:
# [all] - All optional dependencies
# [pptx] - PowerPoint files
# [docx] - Word documents
# [xlsx] - Excel spreadsheets
# [xls] - Older Excel files
# [pdf] - PDF documents
# [outlook] - Outlook messages
# [az-doc-intel] - Azure Document Intelligence
# [az-content-understanding] - Azure Content Understanding
# [audio-transcription] - WAV and MP3 transcription
# [youtube-transcription] - YouTube video transcription
from pathlib import Path
from markitdown import MarkItDown
md = MarkItDown()
pdf_dir, output_dir = Path("papers/"), Path("markdown_output/")
output_dir.mkdir(exist_ok=True)
for pdf_file in pdf_dir.glob("*.pdf"):
try:
result = md.convert_local(pdf_file)
except Exception as e: # keep going; report failures at the end
print(f"✗ {pdf_file.name}: {e}")
continue
(output_dir / f"{pdf_file.stem}.md").write_text(result.markdown)
For larger jobs with logging and parallelism, use scripts/batch_convert.py.
from markitdown import MarkItDown
result = MarkItDown().convert("data.xlsx")
print(result.markdown) # one Markdown table per sheet
Keyless: python scripts/convert_with_ai.py presentation.pptx presentation.md --backend claude,
then describe the staged images yourself (Advanced Features §1). With an OpenRouter key:
import os
from markitdown import MarkItDown
from openai import OpenAI
# OpenRouter takes the dotted slug of an Anthropic model ID (claude-opus-5-5 -> anthropic/claude-opus-5.5);
# scripts/convert_with_ai.py derives it from $ALTERLAB_MODEL (shared/model_env.md).
model = "anthropic/claude-opus-5.5"
# Use OpenRouter for access to multiple AI models
client = OpenAI(
api_key=os.environ["OPENROUTER_API_KEY"],
base_url="https://openrouter.ai/api/v1"
)
md = MarkItDown(
llm_client=client,
llm_model=model, # recommended for presentations
llm_prompt="Describe this slide image in detail, focusing on key visual elements and data"
)
result = md.convert("presentation.pptx")
with open("presentation.md", "w") as f:
f.write(result.markdown)
from markitdown import MarkItDown
md = MarkItDown()
result = md.convert("https://www.youtube.com/watch?v=VIDEO_ID")
print(result.markdown)
# Build image (from the repository root)
docker build -t markitdown:latest .
# Run conversion
docker run --rm -i markitdown:latest < ~/document.pdf > output.md
MarkItDown()markitdown-ocr pluginconvert_with_ai.py and describe them (keyless), or enable a vision model with a keyconvert_local() or convert_stream() rather than convert()from markitdown import MarkItDown, FileConversionException, UnsupportedFormatException
md = MarkItDown()
try:
result = md.convert_local("document.pdf")
print(result.markdown)
except FileNotFoundError:
print("File not found")
except UnsupportedFormatException:
print("No converter for this format (is the matching extra installed?)")
except FileConversionException as e:
print(f"Conversion error: {e}")
Markdown output is already token-efficient, but you can collapse blank lines and strip metadata you do not need:
import re
clean_text = re.sub(r"\n{3,}", "\n\n", result.markdown).strip()
from markitdown import MarkItDown
from pathlib import Path
md = MarkItDown()
# Convert all papers in literature folder
papers_dir = Path("literature/pdfs")
output_dir = Path("literature/markdown")
output_dir.mkdir(exist_ok=True)
for paper in papers_dir.glob("*.pdf"):
result = md.convert(str(paper))
# Save with metadata
output_file = output_dir / f"{paper.stem}.md"
content = f"# {paper.stem}\n\n"
content += f"**Source**: {paper.name}\n\n"
content += "---\n\n"
content += result.markdown
output_file.write_text(content)
# For AI-enhanced conversion with figures
import os
from openai import OpenAI
# Model ID via the ALTERLAB_MODEL convention (shared/model_env.md).
model = "anthropic/claude-opus-5.5" # OpenRouter slug of the ALTERLAB_MODEL default (shared/model_env.md)
client = OpenAI(
api_key=os.environ["OPENROUTER_API_KEY"],
base_url="https://openrouter.ai/api/v1"
)
md_ai = MarkItDown(
llm_client=client,
llm_model=model,
llm_prompt="Describe scientific figures with technical precision"
)
MarkItDown reads files and fetches URLs with the privileges of the current process. When any part of the input comes from an untrusted user (hosted tools, agents acting on web content), validate paths and URLs first, block private and metadata-service addresses, and call the narrowest method (convert_local(), convert_stream(), or convert_response() on a response you fetched yourself) instead of convert().
Missing dependencies (MissingDependencyException): install the feature extra
uv pip install 'markitdown[pdf]' # For PDF support
Binary file errors: convert_stream() requires a binary stream
with open("file.pdf", "rb") as f: # Note the "rb"
result = md.convert_stream(f, stream_info=StreamInfo(extension=".pdf"))
Empty output from a scanned PDF or image: MarkItDown found no text layer. Use the markitdown-ocr plugin, Azure Document Intelligence, or add a text layer locally with ocrmypdf before converting. Installing Tesseract alone does not enable OCR in MarkItDown.
No EXIF metadata for images or audio: install exiftool (or point EXIFTOOL_PATH at it).
MarkItDown() instance across files; creating it loads the file-type detectorspeech_recognition package (network required, slow for long files); don't use it on confidential research recordings such as participant interviews unless your ethics approval allows third-party processingreferences/api_reference.md for complete API documentation, custom converters, and pluginsreferences/file_formats.md for format-specific detailsscripts/batch_convert.py for automation examplesscripts/convert_with_ai.py for conversions with image descriptions (keyless or via OpenRouter)markitdown-ocr, markitdown-mcp)packages/markitdown-sample-plugin in the MarkItDown repositoryPart of the AlterLab Academic Skills suite.
assets/example_usage.md (opens in a new tab)evals/evals.json (opens in a new tab)evals/fixtures/pilot_results.pptx (opens in a new tab)references/api_reference.md (opens in a new tab)references/file_formats.md (opens in a new tab)scripts/batch_convert.py (opens in a new tab)scripts/convert_literature.py (opens in a new tab)scripts/convert_with_ai.py (opens in a new tab)shared/model_env.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/alterlab-document-tools:alterlab-markitdownfrom alterlab-document-tools
npx claudepluginhub alterlab-ieu/alterlab-academic-skills --plugin alterlab-document-tools3 skills in this plugin
/alterlab-open-notebookRuns and scripts Open Notebook, a self-hosted open-source alternative to Google NotebookLM with a full REST API, for AI-powered research and document analysis. Use when organizing research materials into notebooks, ingesting diverse content sources (PDFs, videos, audio, web pages, Office documents), generating AI-powered notes and summaries, creating multi-speaker podcasts from research, chatting with documents using context-aware AI, searching across materials with full-text and vector search, or running custom content transformations. Runs keyless on local models (Ollama or LM Studio; a local Speaches server for podcast voices), with OpenAI, Anthropic, Google, Groq, Mistral and other cloud providers as optional extras, and data kept on your own infrastructure through self-hosting. For a one-shot file-to-Markdown conversion (no notebook, chat, or search), use alterlab-markitdown instead. Part of the AlterLab Academic Skills suite./alterlab-pdf-exploreExplore a single PDF in depth — parse it once, then answer questions across its sections, figures, tables, and appendices — comparing methods across sections, extracting every instance of a pattern within the document, and reading values off its charts and tables. Use when interrogating one paper or report end-to-end, pulling every occurrence of something inside a document, or reading data from a figure/table in a PDF, serving the literature-review and paper-review pipeline. To build a comparison table across MANY papers prefer alterlab-pdf-extract; to simply convert a PDF to Markdown prefer alterlab-markitdown; for reference/citation management prefer alterlab-pyzotero. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job