# MarkItDown quickstart: your first conversions in ten minutes

> Convert your first Word, PDF and Excel files to Markdown from the command line and from Python with our sample files, then learn to judge the output.

Source: https://markitdown.dev/quickstart/ · Updated 2026-11-15·Upstream source ↗

You will convert a Word file, the same document as a PDF and an Excel workbook to Markdown, from the command line and from Python, and learn how to judge what comes out. You need Python 3.10 to 3.14, or nothing at all if you use [the converter in your browser](https://markitdown.dev/online/). Everything here was run on the version in the badge on Windows, macOS and Linux.

> **Short answer**
>
> Install it, convert one file with `-o`, then read the result:
> 
> ```bash
> pip install "markitdown[all]"
> ```
> 
> ```bash
> markitdown report.docx -o report.md
> ```
> 
> In Python it is three actions: create a `MarkItDown()` converter, call `convert()` on a file, and read `.markdown` from the result. No install? [Convert in your browser](https://markitdown.dev/online/).

Tested with markitdown 0.1.9 · Python 3.13 · Ubuntu 24.04, Windows Server 2025 and macOS 26 runners and a Linux lab · 2026-11-15 · evidence: [synthetic\_report.docx.md](https://markitdown.dev/evidence/T05/outputs/synthetic_report.docx.md), [synthetic\_pdf-text.pdf.md](https://markitdown.dev/evidence/T05/outputs/synthetic_pdf-text.pdf.md), [synthetic\_workbook.xlsx.md](https://markitdown.dev/evidence/T05/outputs/synthetic_workbook.xlsx.md), [token-counts.csv](https://markitdown.dev/data/token-counts.csv)

## What MarkItDown does, in 60 seconds

It turns many kinds of file into one kind of text: Markdown that keeps headings, lists, tables and links and drops the layout. That text is meant for language models and search indexes. There are three doors in: the command line (this page), Python code (step 7) and an MCP server for AI apps ([MCP page](https://markitdown.dev/mcp/)). It does not convert back, it does not copy the page layout, and it has no built-in OCR for scanned pages ([OCR page](https://markitdown.dev/ocr/)).

## Step 1: Install

### The one line

The command at the top installs support for every file type. Quote it: the quotes are required in zsh and harmless in the other shells. Then check:

```bash
markitdown --version
```

You should see `markitdown 0.1.9`.

### If it fails

-   `markitdown is not recognized` / `command not found`: [fix the PATH or the environment](https://markitdown.dev/errors/command-not-found/).
-   Nothing happened or `0.0.1a1` appeared: your Python is older than 3.10 ([Python rules](https://markitdown.dev/install/#python-version)).
-   `zsh: no matches found: markitdown[all]`: [quote the requirement](https://markitdown.dev/install/mac/).

### Other systems

Pick your system, installer and shell in [the command builder](https://markitdown.dev/install/#builder).

## Step 2: Get the sample files

All three are original files we made for this guide and release under CC0.

- [report.docx](https://markitdown.dev/samples/report.docx): A Word report with headings, a list, a table, bold, italic, a link and an image.
- [pdf-text.pdf](https://markitdown.dev/samples/pdf-text.pdf): The same report as a PDF.
- [workbook.xlsx](https://markitdown.dev/samples/workbook.xlsx): Two sheets, with dates, a currency column, a percentage, a merged header and a total.

Put them in the folder you will work in.

## Step 3: Convert the Word file

### Run it

Use the command from the top of this page, `markitdown report.docx -o report.md`. `-o` writes `report.md` and prints nothing. Open it in any text editor.

### Read the output

````markdown
Pilot Report: Field Station Alpha

# 1. Summary

This report covers **three sites** during *spring 2026* <u>with underlined</u> ~~and struck text.~~

## 1.1 Key findings

* Rainfall rose 12% year on year
* Sensor uptime reached 99.2%
* Two stations need new batteries
* Nested item under batteries

## 1.2 Next steps

1. Order batteries
2. Recalibrate sensors
3. Publish dataset

# 2. Measurements

|  |  |  |  |
| --- | --- | --- | --- |
| Station | Rainfall (mm) | Uptime | Notes |
| Alpha | 412.5 | 99.2% | Battery low |
| Bravo | 388.0 | 97.8% | OK | stable |
| Charlie | 451.3 | 99.9% | New sensor |

## 2.1 Chart

![](data:image/png;base64...)

Figure 1: Quarterly revenue chart.

### 3. Deep heading level three

Contact: hello@example.org — see https://example.org/data for the dataset. Unicode check: café, naïve, 東京, Ω, emoji 🙂.
````

*synthetic_report.docx.md · 850 bytes*

### What came across and what did not

**Proof comparison:** 5 headings → 4 kept, 1 changed · 1 paragraph → 1 kept · 2 lists → 2 kept · 1 table → 1 kept

````markdown
Pilot Report: Field Station Alpha
 
# 1. Summary
 
This report covers **three sites** during *spring 2026* <u>with underlined</u> ~~and struck text.~~
 
## 1.1 Key findings
 
* Rainfall rose 12% year on year
* Sensor uptime reached 99.2%
* Two stations need new batteries
* Nested item under batteries
 
## 1.2 Next steps
 
1. Order batteries
2. Recalibrate sensors
3. Publish dataset
 
# 2. Measurements
 
|  |  |  |  |
| --- | --- | --- | --- |
| Station | Rainfall (mm) | Uptime | Notes |
| Alpha | 412.5 | 99.2% | Battery low |
| Bravo | 388.0 | 97.8% | OK | stable |
| Charlie | 451.3 | 99.9% | New sensor |
 
## 2.1 Chart
 
![](data:image/png;base64...)
 
Figure 1: Quarterly revenue chart.
 
### 3. Deep heading level three
 
Contact: hello@example.org — see https://example.org/data for the dataset. Unicode check: café, naïve, 東京, Ω, emoji 🙂.
````

- ~ changed heading becomes plain text: Pilot Report: Field Station Alpha
- ✓ kept heading: 1. Summary
- ✓ kept paragraph: This report covers three sites during sp
- ✓ kept heading: 1.1 Key findings
- ✓ kept list: Rainfall rose 12% year on year
- ✓ kept heading: 1.2 Next steps
- ✓ kept list: Order batteries
- ✓ kept heading: 2. Measurements
- ✓ kept table: Station

Kept: headings, bold and italic, both kinds of list, table cells and the link text. Changed in this file: the document's title became plain text rather than a heading; the table has an empty header row with the real header as its first row; a `|` inside a cell (`OK | stable`) is not escaped, which breaks that row; and the chart became a shortened image placeholder.

## Step 4: Convert the same document as a PDF

### Run it and compare

```bash
markitdown pdf-text.pdf -o pdf-text.md
```

````markdown
Pilot Report: Field Station Alpha

1. Summary
Rainfall across the three stations rose steadily through the spring. Sensors reported every ten
minutes and the readings were averaged per day. Rainfall across the three stations rose steadily
through the spring. Sensors reported every ten minutes and the readings were averaged per day.
Rainfall across the three stations rose steadily through the spring. Sensors reported every ten
minutes and the readings were averaged per day.

1.1 Key findings

Rainfall rose 12% year on year

Sensor uptime reached 99.2%

Two stations need new batteries

2. Measurements
Rainfall across the three stations rose steadily through the spring. Sensors reported every ten
minutes and the readings were averaged per day. Rainfall across the three stations rose steadily
through the spring. Sensors reported every ten minutes and the readings were averaged per day.

(cid:127)
(cid:127)
(cid:127)
````

*synthetic_pdf-text.pdf.md · 926 bytes*

### Why it is different

There are no `#` headings, the bullets turned into `(cid:127)` junk and the image is gone. A PDF stores positioned text, not "this is a heading", so the converter has to guess the structure. This is the page's main lesson: **when you can, convert the original Word, Excel or PowerPoint file, not its PDF.** Details and fixes: [PDF page](https://markitdown.dev/formats/pdf/).

## Step 5: Convert a spreadsheet

```bash
markitdown workbook.xlsx -o workbook.md
```

````markdown
## Rainfall
| Station | Date | Rainfall (mm) | Cost | Share |
| --- | --- | --- | --- | --- |
| Alpha | 2026-03-01 | 412.5 | 1200.50 | 0.33 |
| Bravo | 2026-03-02 | 388.0 | 980.00 | 0.31 |
| Charlie | 2026-03-03 | 451.3 | 1410.25 | 0.36 |
| NaN | NaT | NaN | NaN | NaN |
| Total | NaT | 1251.8 | 3590.75 | NaN |

## Notes
| Merged header across three columns | Unnamed: 1 | Unnamed: 2 |
| --- | --- | --- |
| Key | Value | Comment |
| battery | low | NaN |
| NaN | NaN | NaN |
| sensor | new | pipe | inside |

## Empty
|
|  |
````

*synthetic_workbook.xlsx.md · 526 bytes*

Each sheet becomes a `##` section. Look for `NaN` and `NaT` where cells were empty, `Unnamed: 1` where a header was merged, a date shown without its format, and a currency or percentage shown as a plain number. [Spreadsheet page](https://markitdown.dev/formats/excel/).

## Step 6: Print, save, pipe

### Three ways to get output

Leave off `-o` to print to the screen; use `-o file.md` to save; or pipe the output into another program. On Windows always use `-o` and never `>`:

> **Redirecting with > on Windows loses characters:** In our test > replaced Japanese text and an emoji with ? in every shell, while -o kept everything. See the encoding page.

### Input from stdin

**bash and zsh**

```bash
cat report.docx | markitdown
```

**Command Prompt**

```bash
markitdown < report.docx
```

MarkItDown recognised a Word file, a PDF and a CSV piped in without any hint. When it cannot, add `-x .ext`: [CLI reference](https://markitdown.dev/cli/).

### A web page

```bash
markitdown https://example.com
```

Some sites refuse automated requests (Wikipedia answered `403`); see [web pages](https://markitdown.dev/formats/html/).

## Step 7: The same in Python

```python
from pathlib import Path
from markitdown import MarkItDown

md = MarkItDown()                      # create the converter once and reuse it
for name in ("report.docx", "pdf-text.pdf", "workbook.xlsx"):
    result = md.convert(f"samples/{name}")              # convert a file
    out = Path(name).with_suffix(".md")
    out.write_text(result.markdown, encoding="utf-8")   # .markdown is the text
    print(f"{name:<14} -> {out}  {len(result.markdown):>5} characters, first line: {result.markdown.splitlines()[0]!r}")
```

Output · markitdown 0.1.9 · Python 3.13.18 · 2026-11-15

```
report.docx    -> report.md    838 characters, first line: 'Pilot Report: Field Station Alpha'
pdf-text.pdf   -> pdf-text.md    926 characters, first line: 'Pilot Report: Field Station Alpha'
workbook.xlsx  -> workbook.md    526 characters, first line: '## Rainfall'
```

[captured result](https://markitdown.dev/evidence/snippets/api-quickstart-loop/result.json)

Create the converter once and reuse it. Errors and streams: [Python API](https://markitdown.dev/python-api/); whole folders: [batch conversion](https://markitdown.dev/batch/).

## How to judge any conversion

1.  **Headings are present.** If every line is the same size the structure was lost ([PDF page](https://markitdown.dev/formats/pdf/)).
2.  **Tables are real tables**, with the right header row ([PDF](https://markitdown.dev/formats/pdf/), [Excel](https://markitdown.dev/formats/excel/)).
3.  **The reading order is right**, especially in columns.
4.  **Nothing important is missing:** images, notes, comments ([images](https://markitdown.dev/formats/images/), [PowerPoint](https://markitdown.dev/formats/powerpoint/)).
5.  **No junk characters** such as `(cid:127)` or `?` ([encoding](https://markitdown.dev/errors/unicodeencodeerror/)).

Why Markdown for language models: our Word report needed 266 tokens as Markdown against 451 as HTML, and the workbook 209 against 708; plain extracted text is smaller still (191 and 133) but has no structure.

**Chart: Markdown costs more than bare text and far less than HTML** (drawn on the designed page)

Markdown costs more than bare text and far less than HTML
| Item | tokens | Note |
| --- | --- | --- |
| report.docx · raw extracted text | 191 | 665 characters |
| report.docx · HTML | 451 | 1165 characters |
| report.docx · MarkItDown Markdown | 266 | 838 characters |
| pdf-text.pdf · raw extracted text | 189 | 927 characters |
| pdf-text.pdf · HTML | 267 | 1053 characters |
| pdf-text.pdf · MarkItDown Markdown | 188 | 926 characters |
| workbook.xlsx · raw extracted text | 133 | 291 characters |
| workbook.xlsx · HTML | 708 | 1770 characters |
| workbook.xlsx · MarkItDown Markdown | 209 | 526 characters |

## Where to go next

-   [Convert a whole folder](https://markitdown.dev/batch/)
-   [Use it with Claude](https://markitdown.dev/claude/) or [any MCP client](https://markitdown.dev/mcp/)
-   [Scanned PDFs and OCR](https://markitdown.dev/ocr/)
-   [Every file format](https://markitdown.dev/formats/)
-   [Which tool to choose](https://markitdown.dev/compare/)
-   [No Python at all](https://markitdown.dev/online/)

## Related

- [Install MarkItDown](https://markitdown.dev/install/): Every install route and the command builder.
- [CLI reference](https://markitdown.dev/cli/): Every command-line option.
- [Python API guide](https://markitdown.dev/python-api/): The Python API in depth.
- [Supported formats](https://markitdown.dev/formats/): How every file type converts, graded.
- [Error reference](https://markitdown.dev/errors/): If something fails.

---
Independent guide to the open-source MarkItDown library. Not affiliated with or endorsed by Microsoft. Official source: https://github.com/microsoft/markitdown
