Convert Files and URLs to Markdown
All scripts live in scripts/. Run them "as is".
Tool Selection
| Input type |
Command |
Script location |
.pdf, .docx, .pptx, .xlsx, .xls, .csv, .json, .xml, .epub, images (.jpg/.png/etc.), audio (.mp3/.wav/etc.), .html, .txt, .md |
uvx markitdown <path> |
built-in CLI |
| YouTube URL or video ID |
./scripts/youtube-transcript <url_or_id> |
scripts/youtube-transcript |
| Regular web URL (Crawl4AI server running) |
./scripts/web-to-md <url> |
scripts/web-to-md |
.mhtml file or MHTML URL |
./scripts/mhtml-to-md <source> |
scripts/mhtml-to-md |
YouTube Transcript
./scripts/youtube-transcript <url_or_video_id> [--info] [--lang <code>] [--raw]
--info: Include video metadata (title, channel, duration) before transcript.
--lang <code>: Subtitle language (e.g. en, de). Default: auto-detect source language.
--raw: Output raw VTT instead of cleaned text.
MHTML to Markdown
./scripts/mhtml-to-md <path_or_url>
Accepts local .mhtml files or remote URLs serving MHTML content.
Web Page to Markdown (via Crawl4AI)
./scripts/web-to-md <url> [-o output.md] [-s server_url]
Requires a Crawl4AI server running on http://localhost:11235 (or set $CRAWL4AI_URL). The server fetches the full page HTML; this script converts it to Markdown.
No Crawl4AI? Fall back:
curl -o page.html <url> && uvx markitdown page.html
MarkItDown (General File Conversion)
All other formats use uvx markitdown:
uvx markitdown <path> [-o output.md]
Supports: PDF, DOCX, PPTX, XLSX/XLS, images (EXIF + OCR), audio (transcription), EPUB, CSV, JSON, XML, HTML, TXT, ZIP.
When Things Go Wrong
| Issue |
What to do |
| Scanned PDF yields no text |
Try uvx markitdown <path> treating it as an image — markitdown runs OCR on images |
| Password-protected file |
Remove password first; markitdown can't decrypt |
| Large ZIP archive |
Extract specific files first, then convert individually |
| YouTube age-restricted video |
yt-dlp will fail — no workaround |
| Audio transcription poor quality |
Depends on audio clarity; nothing we can do from here |
| Excel has many sheets |
All sheets included as separate tables in output |
1---2name: convert-to-markdown3description: Fetch web content. Use when the user asks to extract text from PDFs, Word docs, PowerPoint, Excel, images, audio, EPUBs, MHTML, YouTube transcripts, or any URL — even if they say 'read this file', 'get the text from', 'extract content', or 'transcribe'.4---56# Convert Files and URLs to Markdown78All scripts live in `scripts/`. Run them "as is".910## Tool Selection1112| Input type | Command | Script location |13|------------|---------|-----------------|14| `.pdf`, `.docx`, `.pptx`, `.xlsx`, `.xls`, `.csv`, `.json`, `.xml`, `.epub`, images (`.jpg`/`.png`/etc.), audio (`.mp3`/`.wav`/etc.), `.html`, `.txt`, `.md` | `uvx markitdown <path>` | built-in CLI |15| YouTube URL or video ID | `./scripts/youtube-transcript <url_or_id>` | `scripts/youtube-transcript` |16| Regular web URL (Crawl4AI server running) | `./scripts/web-to-md <url>` | `scripts/web-to-md` |17| `.mhtml` file or MHTML URL | `./scripts/mhtml-to-md <source>` | `scripts/mhtml-to-md` |1819## YouTube Transcript2021```bash22./scripts/youtube-transcript <url_or_video_id> [--info] [--lang <code>] [--raw]23```2425- `--info`: Include video metadata (title, channel, duration) before transcript.26- `--lang <code>`: Subtitle language (e.g. `en`, `de`). Default: auto-detect source language.27- `--raw`: Output raw VTT instead of cleaned text.2829## MHTML to Markdown3031```bash32./scripts/mhtml-to-md <path_or_url>33```3435Accepts local `.mhtml` files or remote URLs serving MHTML content.3637## Web Page to Markdown (via Crawl4AI)3839```bash40./scripts/web-to-md <url> [-o output.md] [-s server_url]41```4243Requires a [Crawl4AI](https://github.com/unclecode/crawl4ai) server running on `http://localhost:11235` (or set `$CRAWL4AI_URL`). The server fetches the full page HTML; this script converts it to Markdown.4445**No Crawl4AI?** Fall back:46```bash47curl -o page.html <url> && uvx markitdown page.html48```4950## MarkItDown (General File Conversion)5152All other formats use `uvx markitdown`:5354```bash55uvx markitdown <path> [-o output.md]56```5758Supports: PDF, DOCX, PPTX, XLSX/XLS, images (EXIF + OCR), audio (transcription), EPUB, CSV, JSON, XML, HTML, TXT, ZIP.5960## When Things Go Wrong6162| Issue | What to do |63|-------|-----------|64| Scanned PDF yields no text | Try `uvx markitdown <path>` treating it as an image — markitdown runs OCR on images |65| Password-protected file | Remove password first; markitdown can't decrypt |66| Large ZIP archive | Extract specific files first, then convert individually |67| YouTube age-restricted video | yt-dlp will fail — no workaround |68| Audio transcription poor quality | Depends on audio clarity; nothing we can do from here |69| Excel has many sheets | All sheets included as separate tables in output |