minify-html
Extremely fast and smart HTML + JS + CSS minifier
Decision gist · record as of 2026-08-14
Yes, if you need fast HTML minification with integrated CSS and JS optimization. The permissive MIT license, active repository, and precompiled wheels for common platforms make it low-friction to adopt. Medium install friction only applies if you target uncommon architectures; no known vulnerabilities. Aging maintenance status is a minor concern but not a blocker for a stable utility.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Medium install friction due to precompiled wheels for common platforms (Linux x64/ARM64, macOS x64/ARM64, Windows x64) covering Python 3.10–3.12.
- Last release was 293 days ago; repository is active and not archived, though maintenance status is aging.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2025-10-25 (293 days) · last repo commit 2025-11-18 · 1,165 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,437,398 downloads/mo, #3,897 on PyPI
Alternatives
Verify before relying
pip install minify-html
import minify_html
minified = minify_html.minify(" <p>Hello</p> ", minify_js=True, minify_css=True)- Whether precompiled wheels cover all target deployment platforms beyond documented x64/ARM64 Linux, macOS, Windows x64.
- Performance comparison with other Python HTML minifiers in your specific use case.
- Behavior when minifying HTML with embedded templating syntax beyond documented preservation options.
What it is and what it does
minify-html is a Python binding to a Rust HTML minifier that compresses HTML, JavaScript, and CSS in a single pass. It uses oxc for JavaScript minification and lightningcss for CSS, designed to outperform other minifiers in both speed and compression effectiveness. The package handles invalid HTML and can preserve templating syntax via configuration flags.
You import the module and call minify() with your HTML string and optional configuration flags (minify_js, minify_css, keep_comments, etc.). All configuration options default to False if omitted. The binding is built with PyO3 and distributed as precompiled wheels for common platforms; no compilation is required on install for supported systems.
Use it for
- Minify HTML templates in a web build pipeline to reduce payload size before deployment.
- Strip whitespace and optimize embedded CSS/JS in static site generators or template rendering.
- Batch-process HTML files while preserving templating directives like Jinja or Django syntax.
- Reduce HTML response size in a web scraper or HTML processing utility.
- Optimize HTML email templates for smaller file size and faster transmission.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need fast HTML minification with integrated CSS and JS optimization.
The permissive MIT license, active repository, and precompiled wheels for common platforms make it low-friction to adopt. Medium install friction only applies if you target uncommon architectures; no known vulnerabilities. Aging maintenance status is a minor concern but not a blocker for a stable utility.
Install
minify-html on PyPI
Before you install
Medium install friction due to precompiled wheels for common platforms (Linux x64/ARM64, macOS x64/ARM64, Windows x64) covering Python 3.10–3.12. Last release was 293 days ago; repository is active and not archived, though maintenance status is aging.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install minify-html
import minify_html
minified = minify_html.minify(" <p>Hello</p> ", minify_js=True, minify_css=True)
Verify before relying
- Whether precompiled wheels cover all target deployment platforms beyond documented x64/ARM64 Linux, macOS, Windows x64.
- Performance comparison with other Python HTML minifiers in your specific use case.
- Behavior when minifying HTML with embedded templating syntax beyond documented preservation options.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Aging 293 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,437,398 / month, #3,897 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: minify_html-0.18.1-cp310-cp310-macosx_10_12_x86_64.whl; minify_html-0.18.1-cp310-cp310-macosx_11_0_arm64.whl; minify_html-0.18.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; minify_html-0.18.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; minify_html-0.18.1-cp310-cp310-musllinux_1_1_aarch64.whl; minify_html-0.18.1-cp310-cp310-musllinux_1_1_x86_64.whl; minify_html-0.18.1-cp310-cp310-win_amd64.whl; minify_html-0.18.1-cp311-cp311-macosx_10_12_x86_64.whl; minify_html-0.18.1-cp311-cp311-macosx_11_0_arm64.whl; minify_html-0.18.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; minify_html-0.18.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; minify_html-0.18.1-cp311-cp311-musllinux_1_1_aarch64.whl; minify_html-0.18.1-cp311-cp311-musllinux_1_1_x86_64.whl; minify_html-0.18.1-cp311-cp311-win_amd64.whl; minify_html-0.18.1-cp312-cp312-macosx_10_12_x86_64.whl; minify_html-0.18.1-cp312-cp312-macosx_11_0_arm64.whl; minify_html-0.18.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; minify_html-0.18.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; minify_html-0.18.1-cp312-cp312-musllinux_1_1_aarch64.whl; minify_html-0.18.1-cp312-cp312-musllinux_1_1_x86_64.whl
Tags
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 minifier python”
- minify-htmlMinifies HTML, JavaScript, and CSS in a single pass using a…
- django-htmlminMinifies HTML by removing whitespace and comments, reducing response…
- Flask-MinifyFlask extension that automatically minifies HTML, JavaScript, CSS,…
Give your agent the search over MCP, or paste the wish link into any chat.
More HTML packages
MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.
Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.
Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.
Install it if you need to parse or extract data from markup documents.
lxml provides Python bindings to libxml2 and libxslt, enabling parsing, validation, and transformation of XML and HTML documents through an ElementTree-compatible API with support for XPath, XSLT, and schema validation.
Install it if you need robust XML/HTML parsing, validation, or transformation; avoid it only if you must stay pure-Python and can accept slower performance.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
Converts Markdown text to HTML using a Python implementation of John Gruber's Markdown specification, with support for extensions.
Install it if you need to parse Markdown in Python.
See also Flask-Minify · htmlmin2 · mkdocs-minify-plugin · python-minifier · django-htmlmin · rjsmin · css-html-js-minify · stretchable · htmlmin · jsbeautifier