> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/microsoft/markitdown/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to MarkItDown

> Convert any document to Markdown for LLM consumption and text analysis

<img className="block dark:hidden" src="https://mintlify.s3.us-west-1.amazonaws.com/microsoft-markitdown/images/hero-light.svg" alt="MarkItDown Hero Light" />

<img className="hidden dark:block" src="https://mintlify.s3.us-west-1.amazonaws.com/microsoft-markitdown/images/hero-dark.svg" alt="MarkItDown Hero Dark" />

## What is MarkItDown?

MarkItDown is a lightweight Python utility for converting various file formats to Markdown, specifically designed for use with Large Language Models (LLMs) and text analysis pipelines. Built by the Microsoft AutoGen team, it preserves important document structure and content while producing clean, LLM-friendly Markdown output.

While the output is often reasonably presentable and human-friendly, MarkItDown is optimized for consumption by text analysis tools—not for high-fidelity document conversions for human readers.

<CardGroup cols={2}>
  <Card title="Quick start" icon="rocket" href="/quickstart">
    Get up and running in minutes with your first conversion
  </Card>

  <Card title="Installation" icon="download" href="/installation">
    Detailed setup instructions for all environments
  </Card>

  <Card title="Python API" icon="code" href="/api/markitdown">
    Integrate MarkItDown into your applications
  </Card>

  <Card title="CLI reference" icon="terminal" href="/guides/cli-usage">
    Command-line interface documentation
  </Card>
</CardGroup>

## Supported formats

MarkItDown currently supports conversion from a wide range of file types:

<CardGroup cols={3}>
  <Card title="Documents" icon="file-lines">
    * PDF files
    * Word documents (.docx)
    * PowerPoint (.pptx)
    * Excel spreadsheets (.xlsx, .xls)
    * EPub books
  </Card>

  <Card title="Media" icon="image">
    * Images (JPEG, PNG)
    * EXIF metadata extraction
    * OCR via LLM integration
    * Audio transcription
  </Card>

  <Card title="Web & text" icon="globe">
    * HTML pages
    * YouTube videos
    * Wikipedia articles
    * CSV, JSON, XML
    * ZIP archives
  </Card>
</CardGroup>

<Note>
  MarkItDown can also convert Outlook messages, Jupyter notebooks, RSS feeds, and more.
</Note>

## Key features

<AccordionGroup>
  <Accordion title="Structure preservation" icon="sitemap">
    MarkItDown maintains important document structure including:

    * Headings and hierarchy
    * Lists (ordered and unordered)
    * Tables with proper formatting
    * Links and references
    * Code blocks and formatting
  </Accordion>

  <Accordion title="Flexible input sources" icon="arrow-right-to-bracket">
    Convert documents from multiple sources:

    * Local file paths
    * URLs (HTTP/HTTPS)
    * File URIs
    * Data URIs (base64 encoded)
    * Binary streams and file-like objects
    * HTTP Response objects
  </Accordion>

  <Accordion title="LLM integration" icon="brain">
    Enhance conversions with AI:

    * Image description via GPT-4o or other multimodal models
    * Custom prompts for specialized output
    * Optimized for token efficiency
  </Accordion>

  <Accordion title="Azure Document Intelligence" icon="microsoft">
    Use Microsoft's Document Intelligence service for advanced PDF and document processing with superior accuracy and layout understanding.
  </Accordion>

  <Accordion title="Extensible architecture" icon="puzzle-piece">
    * Plugin system for custom converters
    * Priority-based converter registration
    * Custom document converter support
    * Modular optional dependencies
  </Accordion>

  <Accordion title="Smart file detection" icon="magnifying-glass">
    Automatic format detection using:

    * MIME type analysis
    * File extension matching
    * Content-based detection with Magika
    * Charset normalization
  </Accordion>
</AccordionGroup>

## Why Markdown for LLMs?

Markdown is the ideal format for LLM consumption and here's why:

### Natural language alignment

Markdown is extremely close to plain text with minimal markup, making it easy for both humans and AI models to parse and understand.

### Native LLM support

Mainstream LLMs like OpenAI's GPT-4o natively "speak" Markdown and often incorporate it into their responses unprompted. This suggests they have been trained on vast amounts of Markdown-formatted text.

### Token efficiency

Markdown conventions are highly token-efficient compared to HTML or other markup languages. Less tokens means:

* Lower API costs
* Faster processing
* Ability to fit more content in context windows

### Structure preservation

Unlike plain text, Markdown preserves document structure (headings, lists, tables) that helps LLMs understand document organization and relationships between content.

<CodeGroup>
  ```markdown Markdown is concise theme={null}
  # Heading
  - List item 1
  - List item 2

  **Bold text** and *italic text*
  ```

  ```html HTML is verbose theme={null}
  <h1>Heading</h1>
  <ul>
    <li>List item 1</li>
    <li>List item 2</li>
  </ul>

  <p><strong>Bold text</strong> and <em>italic text</em></p>
  ```
</CodeGroup>

## MCP server integration

<Tip>
  MarkItDown offers an MCP (Model Context Protocol) server for seamless integration with LLM applications like Claude Desktop. See [markitdown-mcp](https://github.com/microsoft/markitdown/tree/main/packages/markitdown-mcp) for more information.
</Tip>

The MCP server allows AI assistants to convert documents on-the-fly, enabling powerful document analysis workflows directly within your AI chat interface.

## Get started

<Steps>
  <Step title="Install MarkItDown">
    ```bash theme={null}
    pip install 'markitdown[all]'
    ```
  </Step>

  <Step title="Convert your first document">
    ```bash theme={null}
    markitdown document.pdf > output.md
    ```
  </Step>

  <Step title="Explore the API">
    ```python theme={null}
    from markitdown import MarkItDown

    md = MarkItDown()
    result = md.convert("document.pdf")
    print(result.text_content)
    ```
  </Step>
</Steps>

<Card title="Ready to start?" icon="rocket" href="/quickstart" horizontal>
  Follow the quickstart guide to convert your first document
</Card>
