Skip to main content

DOCX Editor by EigenPal

DOCX to Markdown for Python

Convert Word documents to Markdown, with individual pages, headers, footers, comments, and tracked changes.

Install

Use Python 3.11 or later. Install the package with pip:

pip install docx-to-markdown

Usage

Convert a file and read its document and page output:

from docx_to_markdown import convert

result = convert("contract.docx")
print(result.markdown)

for page in result.pages:
    print(f"Page {page.number}", page.markdown)
    print(page.header_markdown, page.footer_markdown)

result.markdown contains the document body; headers and footers stay in result.pages. Input can be a file path, bytes, or a binary file object.

Options

Enable images, supply font files, and choose a tracked-change view:

result = convert(
    "contract.docx",
    images=True,
    fonts="fonts/",
    google_fonts=True,
    display_mode="proposed",
)
result.write("out/")  # document.md, document.json, media/
  • images=True extracts images; images="html" also preserves displayed sizes.
  • fonts accepts font files or directories. Common Word font substitutes are bundled.
  • google_fonts=True fetches missing fonts from a pinned Google Fonts catalog (requires network access). Use google_font_families() to list supported families and result.missing_fonts to check what still needs local font files.
  • display_mode selects tracked changes: "all-markup" (default), "proposed" (accepted view), or "original" (rejected view).

Comments and tracked changes are available in result.comments and result.tracked_changes. Page breaks can differ from Word; check result.warnings for conversion issues.

Batch conversion

Reuse one converter process for multiple files:

from pathlib import Path
from docx_to_markdown import Converter

with Converter() as converter:
    for path in Path("contracts").glob("*.docx"):
        result = converter.convert(path)
        result.write(Path("output") / path.stem)

Command line

Write Markdown to standard output, save a file, or export a bundle:

docx-to-markdown contract.docx                 # Markdown to stdout
docx-to-markdown contract.docx -o contract.md
docx-to-markdown contract.docx --json
docx-to-markdown *.docx --bundle out/ --images

Documentation · Try the demo · PyPI · Changelog

License

Apache 2.0. Bundled dependencies and fonts retain their own licenses; notices are included in the package.

Metadata

Release files for docx-to-markdown 2.31.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for docx-to-markdown 2.31.0
File
docx_to_markdown-2.31.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
docx_to_markdown-2.31.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
docx_to_markdown-2.31.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
docx_to_markdown-2.31.0-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details
docx_to_markdown-2.31.0-py3-none-macosx_13_0_arm64.whl Python 3 none macOS 13.0+ ARM64 Details

Total release size: 218.0 MB

Release files / docx_to_markdown-2.31.0-py3-none-win_amd64.whl

Download URL docx_to_markdown-2.31.0-py3-none-win_amd64.whl
Size 49.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
177efdba8c7cb6ea03ae31720d3e0da18c1a780194d48ed81b71189a0a022cd8
BLAKE2b-256 checksum
How to use checksums
7876fd2ca75f0509bb81f893f8edef9ca3c54eda9874ff9e990c3d55430d41b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / docx_to_markdown-2.31.0-py3-none-manylinux_2_17_x86_64.whl

Download URL docx_to_markdown-2.31.0-py3-none-manylinux_2_17_x86_64.whl
Size 47.1 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
55538a94ffd36cc15a02ade13777e8e1bcba6d0d0c6cbcfdb23467820565c3ee
BLAKE2b-256 checksum
How to use checksums
faa709ee55bf231186361f4f814691010f5834bd3073abe2f7ad68cd8fca211d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / docx_to_markdown-2.31.0-py3-none-manylinux_2_17_aarch64.whl

Download URL docx_to_markdown-2.31.0-py3-none-manylinux_2_17_aarch64.whl
Size 46.9 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
ba7ac1011d03ea37dd1992ef53f2386e5653c8ed8087496ec8b0cc16a5cab236
BLAKE2b-256 checksum
How to use checksums
0d1ea5208fab9d5d48d10b40b1ab006454a03619810a58d416173955089d4227
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / docx_to_markdown-2.31.0-py3-none-macosx_13_0_x86_64.whl

Download URL docx_to_markdown-2.31.0-py3-none-macosx_13_0_x86_64.whl
Size 38.3 MB
Tags Python 3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
f98bb056ea81a96ded9d33b28f6fbe39e91fc6e23e6a18e34797d0df091c71da
BLAKE2b-256 checksum
How to use checksums
314331ae51c342ab8ba07eec1036222676e24480221eda7c80687c7d6227c49e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / docx_to_markdown-2.31.0-py3-none-macosx_13_0_arm64.whl

Download URL docx_to_markdown-2.31.0-py3-none-macosx_13_0_arm64.whl
Size 36.0 MB
Tags Python 3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
48c0510f49e05509ceaf2d1756ac87deead79185ba5b64eb43293d26634750f3
BLAKE2b-256 checksum
How to use checksums
71e8fea2b4c7c9aab129e700f87f3dc17e2d3d332195100919e71ee2bd9fad0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.31.0 This release

5 release files

2.30.0

5 release files

2.29.0

5 release files

2.28.0

5 release files

2.23.0

5 release files

2.22.0

5 release files

2.21.1

5 release files

2.21.0

5 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page