---
name: markitdown-convert
description: Convert a PDF, Word, Excel or PowerPoint file (or HTML, CSV, EPUB, ZIP) to Markdown with the MarkItDown command line before reading or summarising it. Use when the user gives a document file and wants its text, tables or contents.
---

# Convert documents to Markdown with MarkItDown

Use the `markitdown` command. Never paste a whole large document into the conversation.

## Steps

1. Check the tool exists: `markitdown --version`. If the command is not found, tell the user and offer to run `pip install "markitdown[all]"`. Do not install anything without asking.
2. Convert **to a file**, never to the terminal. Redirecting with `>` can lose characters on Windows:
   `markitdown "<input>" -o "<input-name>.md"`
3. Look at the size before reading: `wc -c "<input-name>.md"` (PowerShell: `(Get-Item "<input-name>.md").Length`).
   - Under about 20,000 characters: read the file.
   - Larger: read the first 200 lines, then use `grep -n "^#"` to list headings and read only the parts you need.
4. If the output file is empty (zero bytes), the input has no text layer, for example a scanned PDF. Say so. Do not guess the contents.
5. If the error mentions `MissingDependencyException` or suggests `pip install 'markitdown[docx]'`, the file type needs an extra. Tell the user which one.

## Know the limits

- PDF: text only. Headings are not detected, and tables are kept only when their columns line up.
- Excel: blank cells appear as `NaN`; formulas that were never calculated also appear as `NaN`.
- Word: a table's first row can come out as an empty header row.
- Images and audio: metadata only, unless the user has set up a model.
- Do not run the command with plugins enabled (`-p`) unless the user asks.
