# AI use cases for Markitdown (microsoft/markitdown)

Repo: [microsoft/markitdown](https://github.com/microsoft/markitdown) | Use cases: 3 | Page: https://dedupedai.com/use-cases/microsoft-markitdown/

MarkItDown is a lightweight Python utility from Microsoft that converts files to Markdown for use with LLMs and text analysis pipelines. It handles PDF, PowerPoint, Word, Excel, images, audio, HTML, CSV, JSON, XML, ZIP files, YouTube URLs and EPubs, keeping structure such as headings, lists, tables and links, and it works from the command line, from Python or in Docker.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Turn Word, Excel and PDF files into Markdown for an LLM: https://dedupedai.com/use-cases/microsoft-markitdown/convert-office-files-to-markdown-for-an-llm/
- Pull text out of images inside PDFs and slides: https://dedupedai.com/use-cases/microsoft-markitdown/ocr-images-inside-documents-with-an-llm/
- Extract invoice fields into YAML front matter: https://dedupedai.com/use-cases/microsoft-markitdown/extract-invoice-fields-with-azure/

## How to turn Word, Excel and PDF files into Markdown for an LLM with Markitdown

Repo: [microsoft/markitdown](https://github.com/microsoft/markitdown) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Install MarkItDown and convert a folder of documents into token-efficient Markdown an LLM can read.

**Who it is for:** An analyst who wants to paste reports, spreadsheets and slide decks into a chat model without losing tables and headings.

**The problem:** Copying text out of PDFs and office files loses the structure, and raw files are not something most LLM pipelines accept.

**The outcome:** Markdown files that keep headings, lists, tables and links, ready to drop into a prompt or an indexing pipeline.

### Steps

1. Create a virtual environment with `python -m venv .venv` and activate it with `source .venv/bin/activate`
2. Install everything with `pip install 'markitdown[all]'`, or only the formats you need with `pip install 'markitdown[pdf, docx, pptx]'`
3. Convert one file with `markitdown path-to-file.pdf -o document.md`
4. Or pipe content in with `cat path-to-file.pdf | markitdown`
5. From Python, call `md.convert("test.xlsx")` on a `MarkItDown(enable_plugins=False)` object and read `result.markdown`

### Prompt to paste into your agent

```text
Install microsoft/markitdown with `pip install 'markitdown[all]'` and convert every file in <folder> to Markdown with `markitdown <file> -o <name>.md`. Put the results in <output folder> and list any file that failed to convert and why.
```

### Caveat

The built-in converters are offline and format specific; scanned PDFs need the OCR plugin or an Azure service for good text.

Risk, untrusted-input: MarkItDown performs I/O with the privileges of the current process, so sanitize inputs before converting files or URLs you do not trust.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/microsoft-markitdown/convert-office-files-to-markdown-for-an-llm/

## How to pull text out of images inside PDFs and slides with Markitdown

Repo: [microsoft/markitdown](https://github.com/microsoft/markitdown) | Difficulty: Intermediate | Time: 20 minutes | Basis: From the README

Add the markitdown-ocr plugin so text in embedded images is extracted with a vision LLM.

**Who it is for:** Someone converting slide decks and PDFs full of screenshots and scanned figures that come out blank.

**The problem:** Text that lives inside embedded images is invisible to a normal converter, so key numbers and labels go missing.

**The outcome:** Markdown that includes the text from images in PDF, DOCX, PPTX and XLSX files.

### Steps

1. Install the plugin with `pip install markitdown-ocr` and an OpenAI-compatible client with `pip install openai`
2. Check installed plugins with `markitdown --list-plugins`
3. In Python, create a MarkItDown object with enable_plugins=True plus your llm_client and llm_model (the README uses OpenAI() and gpt-4o), then run `md.convert("document_with_images.pdf")`
4. Print `result.markdown` and compare it with the plain conversion
5. Remember that without an llm_client the plugin still loads but OCR is silently skipped

### Prompt to paste into your agent

```text
Using microsoft/markitdown with the markitdown-ocr plugin, convert <file> to Markdown with an OpenAI-compatible client and model <model>. Show me which text came from embedded images that the plain converter missed.
```

### Caveat

OCR quality and cost depend on the vision model you pick; every image is a model call.

Risk, credentials: The plugin sends embedded images to the model provider behind your client, so do not run it on confidential files with a hosted model and keep the API key out of your code.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/microsoft-markitdown/ocr-images-inside-documents-with-an-llm/

## How to extract invoice fields into YAML front matter with Markitdown

Repo: [microsoft/markitdown](https://github.com/microsoft/markitdown) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Route PDFs through Azure Content Understanding or Document Intelligence to get structured fields with the Markdown.

**Who it is for:** An operations person who wants vendor names, dates and totals out of invoices as data, not just text.

**The problem:** Plain conversion gives you text, but a workflow needs specific fields in a predictable place.

**The outcome:** Markdown with YAML front matter holding the extracted fields, ready for a script or an agent to read.

### Steps

1. Install the extra with `pip install 'markitdown[az-content-understanding]'`
2. Set the MARKITDOWN_CU_ENDPOINT environment variable once to your Content Understanding endpoint
3. Convert with `markitdown path-to-file.pdf --use-cu`
4. For domain fields, pass a custom analyzer such as `cu_analyzer_id="my-invoice-analyzer"` in Python and read the fields block
5. Use `cu_file_types` to send only PDFs to the cloud, since every routed convert() call is billed

### Prompt to paste into your agent

```text
Using microsoft/markitdown with Azure Content Understanding, convert the invoices in <folder> to Markdown with structured fields. Restrict cloud routing to PDFs with cu_file_types and give me a table of VendorName and InvoiceDate from the front matter.
```

### Caveat

You need your own Azure resource; the README links to setup docs rather than walking through it.

Risk, cost: Each convert() call routed to Content Understanding or Document Intelligence is a billable Azure API call, and some add-ons cost extra.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/microsoft-markitdown/extract-invoice-fields-with-azure/
