markitdown
БесплатноБез исполняемых скриптовНе проверенConverts PDF, Word, Excel, PowerPoint, HTML, CSV, EPUB, ZIP and other files into Markdown text that language models and search indexes can read. Use when a…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
MarkItDown — Convert documents to Markdown for LLMs
Overview
MarkItDown is a Python library and command-line tool from Microsoft that turns office documents, PDFs, web pages and archives into Markdown. It keeps the structure a model needs (headings, lists, tables, links) and drops visual layout. Conversion runs locally; cloud services (Azure, an LLM for OCR) are opt-in.
Instructions
Installation
python -m venv .venv
source .venv/bin/activate
pip install 'markitdown[all]'
markitdown --version
[all] pulls every converter. Install fewer extras to keep the environment small, or run the tool once through uv without installing it:
pip install 'markitdown[pdf,docx,xlsx]'
uvx --from 'markitdown[pdf]' markitdown q3-board-report.pdf
Available extras: pptx, docx, xlsx, xls, pdf, outlook, audio-transcription, youtube-transcription, az-doc-intel, az-content-understanding, all. A missing extra raises MissingDependencyException and names the extra to install.
Convert from the command line
markitdown q3-board-report.pdf -o q3-board-report.md # write to a file
markitdown cost-plan-stage-3.xlsx > cost-plan-stage-3.md # or redirect stdout
cat release-notes.html | markitdown -x html > release-notes.md # stdin needs a type hint
markitdown handover-pack.zip -o handover-pack.md # every file inside the ZIP
markitdown "https://docs.python.org/3/library/pathlib.html" -o pathlib.md # http(s) URL
| Flag | Purpose |
|---|---|
-o, --output |
Output file (default: stdout) |
-x, --extension |
File-type hint, for stdin input |
-m, --mime-type |
MIME type hint |
-c, --charset |
Charset hint, such as UTF-8 |
--keep-data-uris |
Keep base64 images instead of truncating them |
-p, --use-plugins |
Enable installed third-party plugins |
--list-plugins |
List installed plugins and exit |
-d, --use-docintel with -e, --endpoint |
Convert with Azure Document Intelligence |
--use-cu with --cu-endpoint |
Convert with Azure Content Understanding |
--cu-analyzer, --cu-file-types |
Pick an analyzer; limit which file types go to Azure |
The command exits with status 1 when conversion fails, so a loop can record failures:
mkdir -p markdown
for f in contracts/*.docx; do
markitdown "$f" -o "markdown/$(basename "${f%.*}").md" || echo "$f" >> failed.txt
done
Python API
from pathlib import Path
from markitdown import MarkItDown
md = MarkItDown(enable_plugins=False)
result = md.convert_local("contracts/lease-harbour-street.docx")
print(result.title) # None when the format has no title
Path("lease-harbour-street.md").write_text(result.markdown, encoding="utf-8")
Pick the narrowest method that fits the input:
| Method | Accepts |
|---|---|
convert_local(path) |
A file on disk only |
convert_stream(stream, stream_info=...) |
An open binary stream |
convert_response(response) |
A requests.Response fetched by the caller |
convert_uri(uri) |
file:, data:, http: and https: URIs |
convert(source) |
Any of the above; the most permissive |
Streams carry no file name, so pass a hint:
from markitdown import MarkItDown, StreamInfo
md = MarkItDown()
with open("uploads/q3-board-report.pdf", "rb") as fh:
result = md.convert_stream(fh, stream_info=StreamInfo(extension=".pdf"))
print(len(result.markdown))
Errors to handle: FileConversionException (a converter failed, including a missing extra), UnsupportedFormatException (no converter accepts the file), and the built-in FileNotFoundError.
Image descriptions and OCR with an LLM
Out of the box MarkItDown does not OCR. The markitdown-ocr plugin sends embedded images and scanned pages to a vision model through an OpenAI-compatible client.
pip install markitdown-ocr openai
markitdown --list-plugins
from markitdown import MarkItDown
from openai import OpenAI
md = MarkItDown(
enable_plugins=True,
llm_client=OpenAI(max_retries=5),
llm_model="gpt-4o",
llm_prompt="Extract all text from this image, preserving table structure.",
)
result = md.convert("scans/signed-lease-2026.pdf")
print(result.markdown)
Without the plugin, llm_client and llm_model only add descriptions to image files and pictures inside PPTX. The command line has no flags for the LLM client, so OCR needs the Python API. Without llm_client the plugin loads but silently skips OCR.
Azure Document Intelligence and Content Understanding
Both are paid cloud converters for scans, complex tables, audio and video. Copy the endpoint from the resource's Keys and Endpoint page in the Azure portal. Authentication uses AZURE_API_KEY when that variable is set, otherwise DefaultAzureCredential (for example after az login).
pip install 'markitdown[az-doc-intel,az-content-understanding]'
# Document Intelligence: endpoint read from MARKITD
Установить markitdown в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл markitdown?
Converts PDF, Word, Excel, PowerPoint, HTML, CSV, EPUB, ZIP and other files into Markdown text that language models and search indexes can read. Use when a user asks to convert a document to Markdown, turn a PDF or DOCX into text for an LLM, export spreadsheet tables as Markdown, prepare files for RAG ingestion, batch-convert a folder of office documents, or mentions MarkItDown, "markitdown", or "document to markdown".
Как установить скилл markitdown?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл markitdown запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic