Markdown to Word (.docx)
Turn Markdown files into Microsoft Word documents—images, links, tables, and code included.
- Source & issues: github.com/thelifeisstrange/md-to-docx
- Install from PyPI:
pip install "pandoc-md-to-docx[binary]"— run the tool asmd-to-docx
Quick start
pip install "pandoc-md-to-docx[binary]"
md-to-docx your-notes.md --force
This creates your-notes.docx next to your Markdown file. The [binary] extra bundles Pandoc so you do not need a separate Pandoc install.
What this tool does
md-to-docx converts .md files to .docx using Pandoc. It wraps Pandoc with sensible defaults for everyday use:
| You get | How |
|---|---|
| One command per file or many | Pass paths on the command line, or pick files in a terminal menu (macOS/Linux) |
| Sensible defaults | Output name matches the input (report.md → report.docx) |
| Safe overwrites | Prompts in the terminal, or --force / --skip-existing for scripts |
| GitHub READMEs | --from gfm for GitHub-flavored Markdown |
| Word that looks intentional | Built-in style template (--reference-doc bundled) and optional table of contents |
Ideal for documentation, notes, specs, and READMEs you need to share as Word.
Why use this instead of copy-paste or Pandoc alone?
- Copy-paste from VS Code or GitHub often breaks tables, code blocks, and images. This produces a real
.docxwith embedded assets. - Raw
pandoccommands are easy to forget (--resource-path, reference doc, TOC flags). This tool sets the important defaults—especially where to look for images. - Batch and automation — convert many files, set an output folder, and use exit codes in scripts.
Images and links
Local images

For each input file, paths are resolved from that file’s directory, not from where you run the command. Keep images beside the .md file (e.g. docs/guide.md and docs/images/...).
Remote images and links

[Project site](https://example.com)
HTTPS images are fetched when Pandoc can reach them. Markdown links become clickable links in Word.
For edge cases and limits, see Limitations on GitHub.
Installation
pip install "pandoc-md-to-docx[binary]"
| Extra | Purpose |
|---|---|
[binary] |
Bundled Pandoc (recommended) |
| (none) | You must install Pandoc yourself |
Requirements: Python 3.9+
Usage examples
md-to-docx notes.md
md-to-docx notes.md -o ~/Desktop/report.docx --force
md-to-docx README.md --from gfm --reference-doc bundled --force
md-to-docx ch1.md ch2.md -d ./word-output --skip-existing
md-to-docx spec.md --toc --toc-depth 3 --reference-doc bundled --force
Interactive mode (macOS / Linux)
md-to-docx # .md files in current directory
md-to-docx -r # include subdirectories
Use ↑/↓, Space to select, Enter to convert, Esc to cancel. On Windows, pass file paths on the command line instead.
Command reference
| Option | Description |
|---|---|
-o, --output |
Output .docx path (single input only) |
-d, --output-dir |
Directory for output files (batch) |
-f, --force |
Overwrite existing output without prompting |
--skip-existing |
Skip if output already exists |
--rename-on-exists |
Write name (1).docx, etc. |
--from |
Input format: markdown, gfm, commonmark, … |
--reference-doc |
Path to style template, or bundled |
--toc |
Add a table of contents |
--toc-depth N |
Heading levels included in TOC |
-r, --recursive |
Scan subfolders (interactive mode only) |
--version |
Print version and exit |
Help and feedback
- Bug reports & feature requests: GitHub Issues
- Release history: CHANGELOG
License
MIT — see LICENSE.
Metadata
Release files for pandoc-md-to-docx 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pandoc_md_to_docx-0.2.3.tar.gz | 23.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pandoc_md_to_docx-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.0 kB
Release files / pandoc_md_to_docx-0.2.3.tar.gz
| Download URL | pandoc_md_to_docx-0.2.3.tar.gz |
|---|---|
| Size | 23.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3fa0193454983633bf95b3705cbcb5fe06502594b78d7983a0ab1d5878ee721
|
|
BLAKE2b-256 checksum How to use checksums |
11e7ea26e534946e8c634be922ad2bc726a04772a9881097a9f9350905551983
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / pandoc_md_to_docx-0.2.3-py3-none-any.whl
| Download URL | pandoc_md_to_docx-0.2.3-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3289c30b958659ff01c920eacc25ecf300c29954f6cbc80fdb8fb3a21a4dbd2b
|
|
BLAKE2b-256 checksum How to use checksums |
61f9bfe9a2365f2b1770b07f77984e8d7beeed71abddb097aad8249a3057d9bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Security for pandoc-md-to-docx 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.