# The markitdown command

> Every markitdown command-line option with real output: files, stdin and URLs, saving with -o, type and charset hints, plugins, Azure flags, exit codes.

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

`markitdown` converts exactly one input per run and writes Markdown to the screen, or to the file given with `-o`. Everything below was captured on version 0.1.9 on Ubuntu, Windows and macOS (62 scenarios each; all three systems agreed on every exit code).

> **Short answer**
>
> `markitdown [options] [file]`: with no file it reads standard input. To save the result:
> 
> ```bash
> markitdown report.docx -o report.md
> ```
> 
> On Windows always use `-o` rather than `>`: [the redirect loses characters](https://markitdown.dev/errors/unicodeencodeerror/).

Tested with markitdown 0.1.9 · Python Ubuntu 24.04, Windows Server 2025 and macOS 26 runners · Python 3.13 · 62 scenarios on each system (identical results on all three except where stated) · 2026-11-15 · evidence: [cli-flags.json](https://markitdown.dev/data/cli-flags.json), [cli-behaviour.csv](https://markitdown.dev/data/cli-behaviour.csv), [cli-options.csv](https://markitdown.dev/data/cli-options.csv), [cli-exit-codes.csv](https://markitdown.dev/data/cli-exit-codes.csv)

## All options at a glance

Exactly the options defined by the 0.1.9 argument parser, from our own run of each:

Every option of markitdown 0.1.9 (the \`since\` column is the first stable release that has it)
| Option | Argument | What it does | Since | Section |
| --- | --- | --- | --- | --- |
| `-v, --version` |  | Print the version and exit. | v0.0.1 | help |
| `-h, --help` |  | Print usage and exit. | v0.0.1 | help |
| `-o, --output` | file name | Write the Markdown to a UTF-8 file instead of stdout. Needs an existing folder; overwrites silently. | v0.0.1 | output |
| `-x, --extension` | extension | Tell the converter what the input is when reading stdin. Dot optional, case-insensitive. | v0.1.0 | hints |
| `-m, --mime-type` | type/subtype | MIME type hint. Must contain exactly one slash. | v0.1.0 | hints |
| `-c, --charset` | name | Charset hint (any name Python knows). | v0.1.0 | hints |
| `-d, --use-docintel` |  | Use Azure Document Intelligence; needs -e or MARKITDOWN\_DOCINTEL\_ENDPOINT and a file. Not tested by us beyond argument handling. | v0.0.1 | azure |
| `-e, --endpoint` | URL | Document Intelligence endpoint. The environment-variable default was added in 0.1.8. | v0.0.1 (env default v0.1.8) | azure |
| `--use-cu, --use-content-understanding` |  | Use Azure Content Understanding; needs --cu-endpoint. Cannot be combined with -d. | v0.1.6 | azure |
| `--cu-endpoint` | URL | Content Understanding endpoint. | v0.1.6 (env default v0.1.8) | azure |
| `--cu-analyzer` | analyzer id | Pick a Content Understanding analyzer. | v0.1.6 | azure |
| `--cu-file-types` | comma list | Route only these types to Content Understanding; unknown names are rejected. | v0.1.6 | azure |
| `-p, --use-plugins` |  | Load installed third-party plugins. | v0.1.0 | plugins |
| `--list-plugins` |  | List installed plugins and exit 0. | v0.1.0 | plugins |
| `--keep-data-uris` |  | Keep full base64 data URIs (images) instead of truncating them. | v0.1.0 | images |
| `filename` | path, file: URI, data: URI or http(s) URL | The single input. Omit it to read stdin. | v0.0.1 | input |

*Every option of markitdown 0.1.9 (the `since` column is the first stable release that has it) Source: Test T04 · run 43738688922 · markitdown 0.1.9 · cli-options.csv · Download CSV*

There is no folder mode, no `--quiet` or `--verbose`, and no option for an LLM: image descriptions are Python-only ([below](#limits)).

## Help and version

```console
$ markitdown --version
[exit 0] 1.38s  stdin=none
--- stdout (17 bytes, first 2000)
markitdown 0.1.9

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

The full help text, which prints usage examples written for bash:

```console
$ markitdown --help
[exit 0] 0.90s  stdin=none
--- stdout (2636 bytes, first 2000)
usage: SYNTAX:

    markitdown <OPTIONAL: FILENAME>
    If FILENAME is empty, markitdown reads from stdin.

EXAMPLE:

    markitdown example.pdf

    OR

    cat example.pdf | markitdown

    OR

    markitdown < example.pdf

    OR to save to a file use

    markitdown example.pdf -o example.md

    OR

    markitdown example.pdf > example.md

Convert various file formats to markdown.

positional arguments:
  filename

options:
  -h, --help            show this help message and exit
  -v, --version         show the version number and exit
  -o, --output OUTPUT   Output file name. If not provided, output is written
                        to stdout.
  -x, --extension EXTENSION
                        Provide a hint about the file extension (e.g., when
                        reading from stdin).
  -m, --mime-type MIME_TYPE
                        Provide a hint about the file's MIME type.
  -c, --charset CHARSET
                        Provide a hint about the file's charset (e.g., UTF-8).
  -d, --use-docintel    Use Document Intelligence to extract text instead of
                        offline conversion. Requires a valid Document
                        Intelligence Endpoint.
  --use-cu, --use-content-understanding
                        Use Azure Content Understanding to extract text.
                        Requires --cu-endpoint.
  -e, --endpoint ENDPOINT
                        Document Intelligence Endpoint. Required if using
                        Document Intelligence. Defaults to the
                        MARKITDOWN_DOCINTEL_ENDPOINT environment variable.
  --cu-endpoint CU_ENDPOINT
                        Content Understanding Endpoint. Required if using
                        --use-cu. Defaults to the MARKITDOWN_CU_ENDPOINT
                        environment variable.
  --cu-analyzer CU_ANALYZER
                        Content Understanding analyzer ID. If not specified,
                        auto-selects by file type.
  --cu-file-types CU_FILE
--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

## Input

### One file per run

Two paths, a folder and a shell wildcard that expands to several files all fail:

```console
$ markitdown report.docx data.csv
[exit 2] 0.89s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
usage: SYNTAX:

    markitdown <OPTIONAL: FILENAME>
    If FILENAME is empty, markitdown reads from stdin.

EXAMPLE:

    markitdown example.pdf

    OR

    cat example.pdf | markitdown

    OR

    markitdown < example.pdf

    OR to save to a file use

    markitdown example.pdf -o example.md

    OR

    markitdown example.pdf > example.md
markitdown: error: unrecognized arguments: data.csv
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

```console
$ markitdown 'sub dir'
[exit 1] 0.90s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.18/x64/bin/markitdown", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/__main__.py", line 257, in main
    result = markitdown.convert(
        args.filename, stream_info=stream_info, keep_data_uris=args.keep_data_uris
    )
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 349, in convert
    return self.convert_local(source, stream_info=stream_info, **kwargs)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 399, in convert_local
    with open(path, "rb") as fh:
         ~~~~^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: 'sub dir'
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

```console
$ markitdown *.docx
[exit 2] 0.87s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
usage: SYNTAX:

    markitdown <OPTIONAL: FILENAME>
    If FILENAME is empty, markitdown reads from stdin.

EXAMPLE:

    markitdown example.pdf

    OR

    cat example.pdf | markitdown

    OR

    markitdown < example.pdf

    OR to save to a file use

    markitdown example.pdf -o example.md

    OR

    markitdown example.pdf > example.md
markitdown: error: unrecognized arguments: edge-zero-bytes.docx report.docx
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

For folders see [the batch page](https://markitdown.dev/batch/).

### Reading from standard input

Pipe the file in, or redirect it. With no hint, a DOCX, a PDF and a CSV were all recognised from the bytes alone:

```console
$ markitdown < report.docx
[exit 0] 1.16s  stdin=pipe
--- stdout (851 bytes, first 2000)
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 🙂.

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

A hint helps when the type cannot be recognised; it is the next section. A single dash is not stdin: `markitdown -` looks for a file named `-`.

```console
$ markitdown -
[exit 1] 0.93s  stdin=pipe
--- stdout (0 bytes, first 2000)

--- stderr
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.18/x64/bin/markitdown", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/__main__.py", line 257, in main
    result = markitdown.convert(
        args.filename, stream_info=stream_info, keep_data_uris=args.keep_data_uris
    )
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 349, in convert
    return self.convert_local(source, stream_info=stream_info, **kwargs)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 399, in convert_local
    with open(path, "rb") as fh:
         ~~~~^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '-'
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

### URLs and URIs

The argument may be an `http(s)` URL, a `file:` URI or a `data:` URI. All three worked:

```console
$ markitdown https://example.com
[exit 0] 0.94s  stdin=none
--- stdout (157 bytes, first 2000)
This domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

Some sites refuse automated requests: Wikipedia answered 403 in our test.

Reproduced by us

### requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://en.wikipedia.org/wiki/Markdown

The library's default request identifies itself as python-requests, which some sites (Wikipedia from our lab network) refuse. Pages that allow it convert normally (example.com worked).

Affected: 0.1.9 (tested from a data-centre network) · last reproduced 2026-11-15 · [Upstream report](https://github.com/microsoft/markitdown/issues/2820)

### Paths that fail

A missing file ends in a full Python traceback, and the same message appears for a missing output folder ([below](#output)):

```console
$ markitdown missing.docx
[exit 1] 1.00s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.18/x64/bin/markitdown", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/__main__.py", line 257, in main
    result = markitdown.convert(
        args.filename, stream_info=stream_info, keep_data_uris=args.keep_data_uris
    )
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 349, in convert
    return self.convert_local(source, stream_info=stream_info, **kwargs)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 399, in convert_local
    with open(path, "rb") as fh:
         ~~~~^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'missing.docx'
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

UNC and device paths on Windows worked in our tests, contrary to what the upstream release notes suggest ([Windows page](https://markitdown.dev/install/windows/)). File names with spaces work when quoted.

## Output

### To a file with `-o`

`-o` writes UTF-8 and prints nothing, even on Windows (where the file has Windows line endings). It overwrites an existing file without asking and does not create missing folders:

```console
$ markitdown report.docx -o out.md
[exit 0] 1.16s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

```console
$ markitdown report.docx -o nodir/out.md
[exit 1] 1.15s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.18/x64/bin/markitdown", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/__main__.py", line 261, in main
    _handle_output(args, result)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/__main__.py", line 267, in _handle_output
    with open(args.output, "w", encoding="utf-8") as f:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'nodir/out.md'
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

An `-o` with no value is an argument error (exit 2, not 1):

```console
$ markitdown report.docx -o
[exit 2] 0.90s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
usage: SYNTAX:

    markitdown <OPTIONAL: FILENAME>
    If FILENAME is empty, markitdown reads from stdin.

EXAMPLE:

    markitdown example.pdf

    OR

    cat example.pdf | markitdown

    OR

    markitdown < example.pdf

    OR to save to a file use

    markitdown example.pdf -o example.md

    OR

    markitdown example.pdf > example.md
markitdown: error: argument -o/--output: expected one argument
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

### To the screen or a pipe

Text goes to standard output in the console's encoding, with characters it cannot encode replaced by `?`. On Windows that makes `>` unsafe: in our experiment `-o` kept `café`, `東京` and an emoji and every redirect lost the last two ([full results](https://markitdown.dev/errors/unicodeencodeerror/)).

### stderr

Tracebacks and Python warnings go to standard error, so redirected Markdown stays clean. On Linux virtual machines you may see a grey `onnxruntime … GetPciBusId` line there: it is harmless ([error index](https://markitdown.dev/errors/)), and so is the ffmpeg warning ([details](https://markitdown.dev/errors/ffmpeg/)).

## Type and charset hints

Use `-x` (extension), `-m` (MIME type) and `-c` (charset) when the input has no file name or MarkItDown guesses wrong. `-x` takes the extension with or without the dot and is case-insensitive; an empty `-x` is treated as no hint.

```console
$ markitdown -x .csv < data.csv
[exit 0] 0.92s  stdin=pipe
--- stdout (148 bytes, first 2000)
| station | rainfall_mm | notes |
| --- | --- | --- |
| Alpha | 412.5 | Battery, low |
| Bravo | 388.0 | OK \| stable |
| Charlie | 451.3 | café |

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

```console
$ markitdown -m text/csv < data.csv
[exit 0] 0.93s  stdin=pipe
--- stdout (148 bytes, first 2000)
| station | rainfall_mm | notes |
| --- | --- | --- |
| Alpha | 412.5 | Battery, low |
| Bravo | 388.0 | OK \| stable |
| Charlie | 451.3 | café |

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

A hint is trusted over the content, so a wrong one misleads: DOCX bytes declared as CSV came out as raw characters, exit 0:

```console
$ markitdown -x .csv < report.docx
[exit 0] 0.97s  stdin=pipe
--- stdout (32148 bytes, first 2000)
| PKwo]Л[Content_Types].xmlOO0\|(PVM9 | p\(b3i |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| 'ghذ)[Dg{gzdMwuqTMv˺_'E$]#wPtv0o`bu" |  |  |  |  |  |
| ?@+WZ$~KK?&c#pTRg3hPvH~`g^SVk7 | IÊIdF+I\y7K:GʮW:!7\|*.yn ~K]Bc*Gտp}jWk˒7M~IC>.Xpِ6V>÷;&>؈wq*@OɚX(Gs01Ho= |  |  |  |  |
| vU_[B q~=y61VmA.$ˤҎlF#aqm\|"PKwo]y&K@_rels/.relsJ1>E%nUD^DM>n~HھQD]Xcf֛+lWbYՂX)_	!xTYl#@e&6fV >+[)ABD_*mHt(Wu}-ooFL5lw?tH`@pSNd18IqCIώPh[.COS^x$ͼ8g<ѸG-$#WzfuރQp0Z}[6PKwo]BvdocProps/core.xmlMO0@jC Th!!qӅI{ҬˋX&ce0.2Tr(	e؃ |  |  |  |  |  |
| EtΔ4`'6gmuNe[h;B2-Ehvi)H dJ&4pF$ZrbLk<+gd+'z | Nފ	neu'~GV`V(A4 |  |  |  |  |
| G`A0$>`(*3+1;{}eFhtV Pl@U24 |  |  |  |  |  |
| x]ŸCvdwJ$4Jueo?ΟG9y0 |  |  |  |  |  |
| 3oPKwo]ldocProps/app.xmlTn0+]tiAQAC"J1~}9/;;AfNhUPq |  |  |  |  |  |
| sV]q_ʭ-	tWP{bpsO+t@޴{Np\|e@EvPޘQ0Ohy=5GY |  |  |  |  |  |
| Fa3yi(وFM 1`hj{tdgm[<#@ | p |  |  |  |  |
| c@~Fp( SW퐿XAǠ95C(#jaoXq;K;BD*CZo78X杰@iٺ$}>E˰J.!='$b+c)WCZ]N[5v%~o'k=PGvZh.m1u=w8~		lɌlߗ>W$;U{lOI?OG//	PKwo]җm*word/document.xmlYOo6Sl@kI&BIhfIiBIðϰ>0켏GJq\{H?yzq2Ȼ;a#!"aц	"'OQ""Du4qK8Fb%F | 2_ |  | T70p-DZ#C*LѸn6` | b\|(@!RB>BLI |  |
| 3bu0W<0M4 |  |  |  |  |  |
| 2^/֖VB"dIrT܉+(undZ | UxNٱscW?)2^J1VR"M$7^4϶'Jr"ba"G	sR(\((Z؈z"دt?g}.̄G#ʻ%3<ğ.p?wƸ0P&"xB.k)$\|9@m> |  |  |  |  |
| 20	MnG-ZEZu |  |  |  |  |  |
| 4x˔i$6@Oɴ_PLϤ |  |  |  |  |  |
| hf@/'I |  |  |  |  |  |
|  |  |  |  |  |  |
| -cch6u;5-II'8!YbW(xx""Mc=7oqyH^Xn~Ŵ9(8ЀrNp;	"Y^kH! |  |  |  |  |  |
| fN~`.!#9 ƤO`}.v)h | pWde`8hS.::YB7>b~1嬯B`Ί>g:%	5Tdm6kP`kr>>UG=pNK | 7NB#<aL_	qc9zȹW]NgA=]/01M{_=GςJy᭨9/5N%\|L8.+1♍k}H_-;zթI\ | l˼޺Te&M鶪hJfcw<n;6	b@ёزjFm=nmEo^omYtaJvrht`Y\|tZhX\5bYR6er{nt
--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

Bad values are rejected with exit 1:

```console
$ markitdown -m foo
[exit 1] 0.88s  stdin=pipe
--- stdout (23 bytes, first 2000)
Invalid MIME type: foo

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

```console
$ markitdown -c nosuchcharset data.csv
[exit 1] 0.90s  stdin=pipe
--- stdout (26 bytes, first 2000)
Invalid charset: nonsense

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

### Charset before and after

A Windows-1252 CSV without a charset hint, then with `-c cp1252`:

```console
$ markitdown data-cp1252.csv
[exit 0] 1.52s  stdin=none
--- stdout (86 bytes, first 2000)
| station | notes |
| --- | --- |
| Alpha | cafķ dķjÓ vu |
| Bravo | na’ve Ć5 |

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

```console
$ markitdown -c cp1252 data-cp1252.csv
[exit 0] 0.96s  stdin=none
--- stdout (86 bytes, first 2000)
| station | notes |
| --- | --- |
| Alpha | café déjà vu |
| Bravo | naïve €5 |

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

## Keeping images

By default images in a Word file are replaced by a shortened placeholder. `--keep-data-uris` keeps the full base64 image, which makes the output much larger:

```console
$ markitdown docx-images-no-alt.docx
[exit 0] 1.12s  stdin=none
--- stdout (104 bytes, first 2000)
# Images

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

Picture above has no alt text.

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

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

```console
$ markitdown docx-images-no-alt.docx --keep-data-uris
[exit 0] 1.10s  stdin=none
--- stdout (34508 bytes, first 2000)
# Images

![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAFoCAIAAABIUN0GAAAgmUlEQVR4nO3dd1yV5f/H8QsPIgii4gAHigriwJl7pObELe7ZMCvN3KY2rF+WWZm5MsscmFsEBPeepaLIcCGomOYELARB4cDvj1PnSxykcw7IR+H1fPjwIfd9n/v+3Nd13+fNPbVI+OueAgAAeauQdAEAABREBDAAAAIIYAAABBDAAAAIIIABABBAAAMAIIAABgBAAAEMAIAAAhgAAAEEMAAAAghgAAAEEMAAAAgggAEAEEAAAwAggAAGAEAAAQwAgAACGAAAAQQwAAACCGAAAAQQwAAACCCAAQAQQAADACCAAAYAQAABDACAgIIewDGxsQsWLuntNajBSy2qunk0aNSy34BhPyz9+eHDh9KlCRg89DVnF/dV3mukC0FmQ4ePrFSlxsVLEdKF5DLxTa6zZy9nF/eAwO1SBWSSnp7e2bOXW416t27flq4Fz1yBDuANG31av9xx7rwFZ4LPxsTGpqSkxMTEnDwVNHvONy1f7rBr917pAv/Hq99gZxf39Rs2SxcCAfv2Hzxy9Fj3bp41a7hL14JckM3ubGFhMWXy+OTk5Nlfzs37wpDHCm4AL/t55dRpHyYkJlarWmXBd9+cOXXsauS5k78dmjP7s3LlnB48+PPt0eN8/QKky0RBp9VqZ30+x8LCYvKkcdK1IC907PBKvXp1tgZsCwkNk64Fz1YBDeAzwWe/+PIbpVSbl1vt3rnVq0/PsmXLFC5cuHy5ckOHDNy3O7BOndppaWnTP5h59Vq0dLEo0PbuO3D1WnTTJo2rVa0iXQvyyJBBA5RSPy1bIV0Inq0CGsBff/OdVqstW7bMksXfFSlSJNNYe3v7n5YuLlrUJikpacHC70UqBHS8V69VSvXv11u6EOSdHt09ixQpsnPX3nv37kvXgmeoIAZwdPT1X387qZR6843X7O3ts5ymYoXyA/r3VUoFBO5ISEjQD3evVd/ZxT0s7Fym6W/e/MPZxd3Zxf3x48f6gQkJCX7+gW+PHteuvad7rfruteq379T989lf378fY7hE/c0g165dnzz1g+Yt21V182jVpqOvX4Czi3vQ6WCl1PvTP9ItxdnFve0rXTJ+/NSp0+++N6lp87ZV3TxqerzU22vQKu81KSkpRi7FsJ7792OquNZ2dnEPDz9vODYx8VGN2g2cXdwPHzmWZQOatMTsi79z565LtVrOLu7nL1w0nH9SUlLN2g2dXdz3HziUaZQxbaIv749bt6bN+Fg3cf2GzUe/Oz4q6orh4kzaAIwv42lu3b597PhvhQoV6tI5iz5KTk5e+uPPPXr1r+nxUlU3j2Yt2vUfOHzFytUPHvypn8a8jfDqtejxE6c2atq6qptH0+ZtZ376+Z9//qWUSk9P37DRp7fXoFp1GlWvWb+316ADBw8/bSZRUVfGTZiim0njZi+/P/2j27fvGLPWOW83naCgM+MmTGne6hVX97p1GzTt3qvfgoVLnhZpxmwAOd+jG7zUwpjduVixYi+3bpmamurnz1Ww/MxSugABv504pfuHZ5csvtT0unp2XuW9JjU19UxwSJuXW5mxoC9mf7Nm3YaMQy5fjrx8OXLLFv+N672rV3cz/MjJU6cnT/0gOTlZ92NaWtp/LiU9Pf3/Zs1evmK1fkhKSsqZ4LNngs/6+Qeu/WW5nZ2dGUspU6a0Z5dOgdt2rFm34asvZ2Ua67c1IDHxUeXKlV5u3fI/K8xmicYU7+Tk2LpVi0OHj2728a0988NMc96xc09CYmLZsmXatmltdpsEnw2ZNmOm/jet2Li4bdt3HTp8LMBvo5ubqzErmCUzuiaT47+eUEq5ulYz/E3xyZMn/QYOCw0N1w/549atP27dOnHy1LlzF+Z9O0c30IyN8FTQmYyddev27ZWrfjl2/LdtW30mTZm2fcdu/ZRngs++PvKdpUsWeHbp
--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

## Plugins

Plugins are off unless you pass `-p`. With none installed, `--list-plugins` prints one line and exits 0, and `-p` changes nothing:

```console
$ markitdown --list-plugins
[exit 0] 0.88s  stdin=none
--- stdout (151 bytes, first 2000)
Installed MarkItDown 3rd-party Plugins:

  * No 3rd-party plugins installed.

Find plugins by searching for the hashtag #markitdown-plugin on GitHub.

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

## Azure Document Intelligence and Content Understanding flags

The options `-d`, `-e`, `--use-cu`, `--cu-endpoint`, `--cu-analyzer` and `--cu-file-types` select two Azure services. **We did not test either service: it needs an Azure account we do not have.** What we did test is what the command says without them:

```console
$ markitdown -d report.docx
[exit 1] 0.89s  stdin=none
--- stdout (133 bytes, first 2000)
Document Intelligence Endpoint is required when using Document Intelligence. Pass -e/--endpoint or set MARKITDOWN_DOCINTEL_ENDPOINT.

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

```console
$ markitdown --use-cu report.docx
[exit 1] 0.88s  stdin=none
--- stdout (130 bytes, first 2000)
Content Understanding Endpoint (--cu-endpoint) is required when using --use-cu. Pass --cu-endpoint or set MARKITDOWN_CU_ENDPOINT.

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

`-d` and `--use-cu` together are an argument error:

```console
$ markitdown -d --use-cu report.docx
[exit 2] 0.89s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
usage: SYNTAX:

    markitdown <OPTIONAL: FILENAME>
    If FILENAME is empty, markitdown reads from stdin.

EXAMPLE:

    markitdown example.pdf

    OR

    cat example.pdf | markitdown

    OR

    markitdown < example.pdf

    OR to save to a file use

    markitdown example.pdf -o example.md

    OR

    markitdown example.pdf > example.md
markitdown: error: argument --use-cu/--use-content-understanding: not allowed with argument -d/--use-docintel
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

One behaviour to know: pointing `-d` at an endpoint that does not exist did not fail for a DOCX; the file was converted locally and no error was printed.

```console
$ markitdown -d -e http://127.0.0.1:9 report.docx
[exit 0] 1.21s  stdin=none
--- stdout (851 bytes, first 2000)
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 🙂.

--- stderr
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

The 0.1.9 parser has no `--docintel-model-id`, `--docintel-features` or `--docintel-query-fields` option.

## Environment variables

Variables the command reads
| Variable | Read by | Effect | Verified |
| --- | --- | --- | --- |
| `MARKITDOWN_DOCINTEL_ENDPOINT` | \-e / -d | default for --endpoint (Document Intelligence) | yes: c48, conversion proceeded with only the variable set |
| `MARKITDOWN_CU_ENDPOINT` | \--cu-endpoint / --use-cu | default for --cu-endpoint; without it the CLI prints 'Content Understanding Endpoint (--cu-endpoint) is required' | yes: the message names it; with it set to an unreachable host the file still converted |
| `EXIFTOOL_PATH` | image and audio metadata | path to the ExifTool program to use instead of the one on PATH | yes: a wrong path produced 'Failed to invoke exiftool at /nonexistent/exiftool' |
| `AZURE_API_KEY` | \--use-docintel, --use-cu | key for the Azure services; otherwise a default Azure credential is used | not tested by us (no Azure account); read from the source |
| `PYTHONUTF8, PYTHONIOENCODING` | Python itself | output encoding when redirecting (not a MarkItDown variable) | yes: see the Windows encoding page |

*Variables the command reads Source: Test T04, T41 · cli-env.csv · Download CSV*

## Exit codes

Measured without pipes, on three systems. Argument errors from the parser exit 2; the CLI's own one-line messages and unhandled conversion exceptions exit 1; success exits 0, including when the output is empty:

Exit codes by situation (ubuntu, macos, windows)
| Situation | Linux | macOS | Windows | Last line printed |
| --- | --- | --- | --- | --- |
| markitdown --version | 0 | 0 | 0 | markitdown 0.1.9 |
| \-o writes a file | 0 | 0 | 0 | (nothing printed) |
| \-o into a folder that does not exist | 1 | 1 | 1 | FileNotFoundError: \[Errno 2\] No such file or directory: 'nodir/out.md' |
| \-o with no value | 2 | 2 | 2 | markitdown: error: argument -o/--output: expected one argument |
| \-m with an invalid MIME type | 1 | 1 | 1 | Invalid MIME type: foo |
| \-c with an unknown charset | 1 | 1 | 1 | Invalid charset: nonsense |
| \-d without an endpoint | 1 | 1 | 1 | Document Intelligence Endpoint is required when using Document Intelligence. Pass -e/--endpoint or set MARKITD |
| \--use-cu without an endpoint | 1 | 1 | 1 | Content Understanding Endpoint (--cu-endpoint) is required when using --use-cu. Pass --cu-endpoint or set MARK |
| \-d and --use-cu together | 2 | 2 | 2 | markitdown: error: argument --use-cu/--use-content-understanding: not allowed with argument -d/--use-docintel |
| an unknown option | 2 | 2 | 2 | markitdown: error: unrecognized arguments: --nope |
| two files | 2 | 2 | 2 | markitdown: error: unrecognized arguments: data.csv |
| a folder | 1 | 1 | 1 | IsADirectoryError: \[Errno 21\] Is a directory: 'sub dir' |
| a missing file | 1 | 1 | 1 | FileNotFoundError: \[Errno 2\] No such file or directory: 'missing.docx' |
| an unsupported type (.gif) | 1 | 1 | 1 | markitdown.\_exceptions.UnsupportedFormatException: Could not convert stream to Markdown. No converter attempte |
| a zero-byte DOCX | 1 | 1 | 1 | \- DocxConverter threw BadZipFile with message: File is not a zip file |
| an encrypted PDF | 1 | 1 | 1 | \- PdfConverter threw PDFPasswordIncorrect with message: |
| \-d with an unreachable endpoint (the file still converts) | 0 | 0 | 0 | Pilot Report: Field Station Alpha |

*Exit codes by situation (ubuntu, macos, windows) Source: Test T04 · run 43738688922 · cli-exit-codes.csv · Download CSV*

## What the CLI does not do

| Limitation | What to use instead |
| --- | --- |
| Several files or a folder | [A loop or the Python API](https://markitdown.dev/batch/) |
| Image descriptions or OCR: the options of the OCR plugin's README are not CLI options, and `--llm-client` is an unknown argument | [The Python API](https://markitdown.dev/python-api/) |
| A password for an encrypted PDF | Remove the password with another tool first |

```console
$ markitdown --llm-client openai --llm-model gpt-4o report.docx
[exit 2] 0.93s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
usage: SYNTAX:

    markitdown <OPTIONAL: FILENAME>
    If FILENAME is empty, markitdown reads from stdin.

EXAMPLE:

    markitdown example.pdf

    OR

    cat example.pdf | markitdown

    OR

    markitdown < example.pdf

    OR to save to a file use

    markitdown example.pdf -o example.md

    OR

    markitdown example.pdf > example.md
markitdown: error: unrecognized arguments: --llm-client report.docx
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

## Shell differences in one place

Quote any path with spaces (`"my file.docx"`). `>` and `|` behave differently on Windows PowerShell 5.1 (it writes UTF-16), PowerShell 7 and Command Prompt: use `-o`. In zsh and bash a wildcard such as `*.docx` is expanded by the shell, so it becomes several arguments. See [Windows](https://markitdown.dev/install/windows/) and [macOS](https://markitdown.dev/install/mac/).

## Common CLI errors

| Message | Cause | Go to |
| --- | --- | --- |
| `markitdown: error: unrecognized arguments` | A second file, a wildcard, or a flag from an old tutorial | [One file per run](#one-file) |
| `IsADirectoryError` | You passed a folder | [Batch conversion](https://markitdown.dev/batch/) |
| `FileNotFoundError` | Wrong path, or a missing output folder | [Paths that fail](#paths) |
| `Invalid charset` / `Invalid MIME type` | A bad `-c` or `-m` value | [Type and charset hints](#hints) |
| `Document Intelligence Endpoint is required` | `-d` without `-e` | [Azure flags](#azure) |
| `UnsupportedFormatException` | No converter for the type | [Missing dependency and unsupported types](https://markitdown.dev/errors/missing-dependency/) |
| `…threw MissingDependencyException` | An extra is not installed | [The same page](https://markitdown.dev/errors/missing-dependency/) |

```console
$ markitdown unsupported.gif
[exit 1] 0.90s  stdin=none
--- stdout (0 bytes, first 2000)

--- stderr
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.18/x64/bin/markitdown", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/__main__.py", line 257, in main
    result = markitdown.convert(
        args.filename, stream_info=stream_info, keep_data_uris=args.keep_data_uris
    )
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 349, in convert
    return self.convert_local(source, stream_info=stream_info, **kwargs)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 403, in convert_local
    return self._convert(file_stream=fh, stream_info_guesses=guesses, **kwargs)
           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.18/x64/lib/python3.13/site-packages/markitdown/_markitdown.py", line 693, in _convert
    raise UnsupportedFormatException(
        "Could not convert stream to Markdown. No converter attempted a conversion, suggesting that the filetype is simply not supported."
    )
markitdown._exceptions.UnsupportedFormatException: Could not convert stream to Markdown. No converter attempted a conversion, suggesting that the filetype is simply not supported.
```

*markitdown 0.1.9 · Ubuntu 24.04 runner · Python 3.13 · 2026-11-15*

## Related

- [Convert a folder](https://markitdown.dev/batch/): Convert a whole folder: loops and scripts.
- [Quickstart](https://markitdown.dev/quickstart/): Your first conversion, step by step.
- [UnicodeEncodeError and garbled output on Windows](https://markitdown.dev/errors/unicodeencodeerror/): Why saving with > loses characters on Windows.
- [Error reference](https://markitdown.dev/errors/): Every error message the command can print.
- [Python API guide](https://markitdown.dev/python-api/): The same conversion from Python code.

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