Start
MarkItDown quickstart: your first conversions in ten minutes
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. 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:
pip install "markitdown[all]"markitdown report.docx -o report.mdIn 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.
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, synthetic_pdf-text.pdf.md, synthetic_workbook.xlsx.md, 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). It does not convert back, it does not copy the page layout, and it has no built-in OCR for scanned pages (OCR page).
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:
markitdown --versionYou should see markitdown 0.1.9.
If it fails
markitdown is not recognized/command not found: fix the PATH or the environment.- Nothing happened or
0.0.1a1appeared: your Python is older than 3.10 (Python rules). zsh: no matches found: markitdown[all]: quote the requirement.
Other systems
Pick your system, installer and shell in the command builder.
Step 2: Get the sample files
All three are original files we made for this guide and release under CC0.
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
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

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 🙂.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
- Order batteries
- Recalibrate sensors
- Publish dataset
2. Measurements
| Station | Rainfall (mm) | Uptime | Notes |
| Alpha | 412.5 | 99.2% | Battery low |
| Bravo | 388.0 | 97.8% | OK |
| Charlie | 451.3 | 99.9% | New sensor |
2.1 Chart
[image]
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 🙂.
What came across and what did not
5 headings → 4 kept, 1 changed · 1 paragraph → 1 kept · 2 lists → 2 kept · 1 table → 1 kept
Input · report.docx
Output · markitdown report.docx
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

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
markitdown pdf-text.pdf -o pdf-text.mdPilot 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)
Pilot Report: Field Station Alpha
- 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
- 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)
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.
Step 5: Convert a spreadsheet
markitdown workbook.xlsx -o workbook.md## 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
|
| |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 |
Empty
| | |
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.
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 >:
Input from stdin
cat report.docx | markitdownmarkitdown < report.docxMarkItDown recognised a Word file, a PDF and a CSV piped in without any hint. When it cannot, add -x .ext: CLI reference.
A web page
markitdown https://example.comSome sites refuse automated requests (Wikipedia answered 403); see web pages.
Step 7: The same in 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}")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' Create the converter once and reuse it. Errors and streams: Python API; whole folders: batch conversion.
How to judge any conversion
- Headings are present. If every line is the same size the structure was lost (PDF page).
- Tables are real tables, with the right header row (PDF, Excel).
- The reading order is right, especially in columns.
- Nothing important is missing: images, notes, comments (images, PowerPoint).
- No junk characters such as
(cid:127)or?(encoding).
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.
Markdown costs more than bare text and far less than HTML
Tokens for the same sample document in three forms (OpenAI cl100k_base, counted locally; o200k_base differs by under 4%)
- Other form
- MarkItDown
| 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 |
Test T22 · markitdown 0.1.9 · mammoth 1.13 for HTML, pdfminer.six for PDF text, openpyxl and pandas for the workbook · 2026-11-15 · token-counts.csv
Where to go next