$npx skillfedfor your agent

html2docx

Convert valid HTML input to docx.

With conditionsPyPI Python ModulesReleased Jan 2023119.7K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — html2docx-1.6.0-py3-none-any.whl
v1.6.0 · released 2023-01-19 · Python >=3.7 · 2 runtime deps: python-docx, tinycss2

Yes, if you need straightforward HTML-to-Word conversion and can work with valid HTML input. The low install friction, permissive MIT license, and Production/Stable status make it a reasonable choice. However, dormant maintenance (last release January 2023) means you should verify that it works with your specific HTML/CSS requirements and check for any compatibility issues with current versions of its dependencies before committing to production use.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • HTML input must be valid; malformed HTML will cause conversion to fail.
  • Low friction installation with only two runtime dependencies (python-docx and tinycss2).
  • Maintenance is dormant—last release was 2023-01-19 and last commit 2024-01-16—but the package is marked Production/Stable and the repository remains active and unarchived.

License · maintenance · safety

MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice.

last release 2023-01-19 (1303 days) · last repo commit 2024-01-16 · 38 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 119,726 downloads/mo, #12,059 on PyPI

Verify before relying

pip install html2docx

from html2docx import html2docx

with open("my.html") as fp:
    html = fp.read()

buf = html2docx(html, title="My Document")

with open("my.docx", "wb") as fp:
    fp.write(buf.getvalue())
  • What HTML features and CSS properties are actually supported by the conversion (the fact sheet does not detail the scope of HTML/CSS handling).
  • Whether tinycss2 dependency is used for CSS parsing and what styling limitations exist in the output.
  • Current compatibility with recent versions of python-docx and tinycss2.
Same gist for agents: .md · .json

What it is and what it does

html2docx is a Python library that transforms valid HTML documents into Microsoft Word (.docx) files. It takes HTML as input and returns a BytesIO object containing the Word document, which you can then write to disk or process further. The package wraps python-docx for document generation and tinycss2 for CSS parsing, handling the translation from web markup to Office Open XML format.

The library is straightforward to use: read or construct your HTML, pass it to the html2docx() function with optional metadata like a title, and get back a binary buffer ready to save. It is marked Production/Stable and supports Python 3.7 through 3.10, though maintenance has been dormant since early 2023. The main constraint is that your HTML must be valid; the package does not attempt to repair or work around malformed markup.

Use it for

  • Export HTML reports or templates generated by a web application into Word documents for distribution or archival.
  • Convert email HTML content to .docx files for offline storage or sharing with non-technical users.
  • Generate Word documents programmatically from HTML templates in data processing or document generation pipelines.
  • Build a document conversion microservice that accepts HTML and returns downloadable .docx files.
  • Transform HTML documentation or help content into Word format for print or formal distribution.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need straightforward HTML-to-Word conversion and can work with valid HTML input.

The low install friction, permissive MIT license, and Production/Stable status make it a reasonable choice. However, dormant maintenance (last release January 2023) means you should verify that it works with your specific HTML/CSS requirements and check for any compatibility issues with current versions of its dependencies before committing to production use.

Install

html2docx on PyPI

Before you install

Low friction installation with only two runtime dependencies (python-docx and tinycss2). Maintenance is dormant—last release was 2023-01-19 and last commit 2024-01-16—but the package is marked Production/Stable and the repository remains active and unarchived.

HTML input must be valid; malformed HTML will cause conversion to fail.

License in practice

MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice.

Quickstart

pip install html2docx

from html2docx import html2docx

with open("my.html") as fp:
    html = fp.read()

buf = html2docx(html, title="My Document")

with open("my.docx", "wb") as fp:
    fp.write(buf.getvalue())

Verify before relying

  • What HTML features and CSS properties are actually supported by the conversion (the fact sheet does not detail the scope of HTML/CSS handling).
  • Whether tinycss2 dependency is used for CSS parsing and what styling limitations exist in the output.
  • Current compatibility with recent versions of python-docx and tinycss2.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.7
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
python-docxtinycss2
MaintenanceDormant 1,303 days since the last release
Last repo commit
First released
Downloads119,726 / month, #12,059 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Evidence: html2docx-1.6.0-py3-none-any.whl

Tags

Capabilities
html to docx conversionconvert html to word documenthtml to microsoft wordgenerate docx from htmlhtml document exportcreate word files from htmlhtml2docx
Topics
document-generationformat-conversion

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “html document export”

  • html2docxConverts valid HTML to Microsoft Word (.docx) format, returning a…
  • weasyprintWeasyPrint converts HTML and CSS into PDF documents using a…
  • mkdocs-print-site-pluginMkDocs plugin that generates a combined print page of your entire…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also html-for-docx · pdf2docx · htmldocx · doc2docx · docx2pdf · mammoth · docx · docx2python · mf2py · msoffcrypto-tool