LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

markitdown

Convert files to Markdown

TLDR

Convert a file and print Markdown
$ markitdown [path/to/file.pdf]
copy
Read standard input and write a file
$ markitdown -x [pdf] -o [document.md]
copy
Save to a file
$ markitdown [path/to/file.pdf] -o [document.md]
copy
Keep embedded data URIs instead of truncating them
$ markitdown --keep-data-uris [path/to/file.docx]
copy
List installed plugins
$ markitdown --list-plugins
copy
Convert with plugins enabled
$ markitdown --use-plugins [path/to/file.pdf]
copy
Use Azure Document Intelligence
$ markitdown [path/to/file.pdf] -d -e [https://example.cognitiveservices.azure.com]
copy
Use Azure Content Understanding
$ markitdown [path/to/file.pdf] --use-cu --cu-endpoint [https://example.cognitiveservices.azure.com]
copy

SYNOPSIS

markitdown [OPTIONS] [FILENAME]

DESCRIPTION

markitdown converts PDF, Office, HTML, images, audio, and other files to Markdown. It is Microsoft's Python package of the same name. Supported Python versions are 3.10 through 3.14.With no filename it reads standard input, which is how a pipe or a container invocation feeds it a file. Optional extras turn on individual formats (PDF, Office, audio, Azure). The extra named all installs every optional dependency. Plugins, including the OCR plugin, stay disabled until --use-plugins.Document Intelligence and Content Understanding cannot be selected together. Cloud conversion needs the matching extra and an endpoint.

PARAMETERS

FILENAME

File to convert. If omitted, read standard input.
-o, --output FILE
Write Markdown to this file. The default is standard output.
-x, --extension EXT
Hint the file extension, useful when reading standard input. A leading dot is optional.
-m, --mime-type TYPE
Hint the MIME type.
-c, --charset CHARSET
Hint the character set, such as UTF-8.
-d, --use-docintel
Extract text with Azure Document Intelligence instead of the offline converter. Mutually exclusive with --use-cu.
-e, --endpoint URL
Document Intelligence endpoint. If omitted, the value of this variable is used:
$ MARKITDOWN_DOCINTEL_ENDPOINT
copy
--use-cu, --use-content-understanding
Extract text with Azure Content Understanding. Mutually exclusive with --use-docintel. Needs --cu-endpoint or this variable:
$ MARKITDOWN_CU_ENDPOINT
copy
--cu-endpoint URL
Content Understanding endpoint.
--cu-analyzer ID
Content Understanding analyzer id. If omitted, an analyzer is chosen from the file type.
--cu-file-types LIST
Comma-separated file types to send to Content Understanding, such as pdf,jpeg,mp4. If omitted, every supported type is sent.
--docintel-model-id ID
Document Intelligence model id, such as prebuilt-layout. That id is the default.
--docintel-query-fields LIST
Comma-separated field names for the Document Intelligence queryFields add-on (OCR file types).
--docintel-features LIST
Comma-separated Document Intelligence add-ons for OCR file types: barcodes, formulas, keyValuePairs, languages, ocrHighResolution, styleFont. none requests none. Some add-ons are billed extra.
-p, --use-plugins
Enable third-party plugins. Plugins are off unless this is set.
--list-plugins
List installed plugins and exit.
--keep-data-uris
Keep data URIs, such as base64 images, in the output. By default they are truncated.
-v, --version
Show the version and exit.
-h, --help
Show help and exit.

INSTALL

nix profile install nixpkgs#markitdown
copy

CAVEATS

The process reads and writes with its own privileges. A cloud endpoint sends the file to Azure. Plugins and optional extras are separate installs. Do not treat a Docker image tag as a distro package.

SEE ALSO

pandoc(1), docling(1), python3(1)

RESOURCES

Copied to clipboard
Kai