HTMLMinifier

JSON →
library 4.0.0 ·javascript
verified Jun 4, 2026

A highly configurable, well-tested JavaScript-based HTML minifier. Current stable version is 4.0.0, with a mature release cadence (last release in 2020). It compresses HTML by removing unnecessary whitespace, comments, and attributes, and offers a wide range of options for fine-grained control. Compared to alternatives like minimize or htmlcompressor.com, it consistently achieves better compression ratios across various real-world websites. It supports both Node.js and CLI usage, and has TypeScript type definitions available via @types/html-minifier.