HTMLMinifier

JSON →
library 4.0.2 ·javascript
verified Jun 4, 2026

HTMLMinifier is a highly configurable, well-tested JavaScript-based HTML minifier that reduces HTML size by removing unnecessary spaces, comments, and attributes. The current stable version is 4.0.2, with regular updates via npm. It offers extensive options (e.g., collapseWhitespace, removeComments, minifyCSS, minifyJS) for fine-grained control over minification. Unlike alternatives like html-compressor or minimize, it handles inline CSS/JS compression and runs in the browser. Released since 2011, it remains a go-to tool for optimizing HTML for production with a focus on safety and performance.