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.34.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.34.0
File Actions
docx_to_markdown-2.34.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for docx_to_markdown-2.34.0-py3-none-win_amd64.whl
docx_to_markdown-2.34.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for docx_to_markdown-2.34.0-py3-none-manylinux_2_17_x86_64.whl
docx_to_markdown-2.34.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for docx_to_markdown-2.34.0-py3-none-manylinux_2_17_aarch64.whl
docx_to_markdown-2.34.0-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details for docx_to_markdown-2.34.0-py3-none-macosx_13_0_x86_64.whl
docx_to_markdown-2.34.0-py3-none-macosx_13_0_arm64.whl Python 3 none macOS 13.0+ ARM64 Details for docx_to_markdown-2.34.0-py3-none-macosx_13_0_arm64.whl

Total release size: 269.3 MB

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

Download URL docx_to_markdown-2.34.0-py3-none-win_amd64.whl
Size 60.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
af2bc6daf138a0e3b95802b0de7eaa4640d7ee81ac3bf81337c04b64cfde7754
BLAKE2b-256 checksum
How to use checksums
c3c5bb2711aba63cba8e923e3ee35f4a7c8408a3f0d9cb0a71ce85c87613368a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

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

Download URL docx_to_markdown-2.34.0-py3-none-manylinux_2_17_x86_64.whl
Size 57.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5b9e86eade96331bb24445b2245e05f1410478af91510b1d356e99e8e1e188f8
BLAKE2b-256 checksum
How to use checksums
aa6ced5b5d2274c16519ccb00bd91397c73259dd9d4523156b3b39567d518cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

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

Download URL docx_to_markdown-2.34.0-py3-none-manylinux_2_17_aarch64.whl
Size 57.0 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
50142df5a6c70ba00656c46317fb50d5d603e5af144694a9ea17a012c9d4c675
BLAKE2b-256 checksum
How to use checksums
a0836d06cd0a94ebe4f4cc419a82cf441881f622fa06a79fd73599115f94fa27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

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

Download URL docx_to_markdown-2.34.0-py3-none-macosx_13_0_x86_64.whl
Size 48.8 MB
Tags Python 3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
1a8543e5bf7a7079481d1c1bbd5b6a787103268c0546905b2cc17c4912b53217
BLAKE2b-256 checksum
How to use checksums
77d608094cde50dab3871ffaf1777a3c8a63dbec8ce9dd65c7d9c7b19cb3d866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

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

Download URL docx_to_markdown-2.34.0-py3-none-macosx_13_0_arm64.whl
Size 46.2 MB
Tags Python 3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
0148e2f6b2576f8df4945b1d31283bd368fec821822f3eed5b5a8e5e89d81743
BLAKE2b-256 checksum
How to use checksums
bcb34bc37bbfb9a94f00767d4a83e502f294256ef75fdaae0c021cb5ffeca664
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

Security for docx-to-markdown 2.34.0

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for docx_to_markdown-2.34.0-py3-none-win_amd64.whl

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 Nov 2, 2026.

Transparency log

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.

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