HTML Minifiers Benchmarks
May 7, 2026 ยท View on GitHub
Updated: 2026-05-07
This benchmark measures how well different tools minify real-world HTML pages. For every URL, the page is fetched and the same source HTML is passed to each minifier. Each minifier is run with aggressive settings, including CSS/JS/SVG optimization when supported. Results are reported as minification rate (percentage size reduction vs the original HTML). Higher is better.
| Website | Source (KB) | html-minifier-terser | html-minifier-next | htmlnano | minify | minify-html | swc-html |
|---|---|---|---|---|---|---|---|
| alistapart.com | 63 | 7.4% | 11.3% | 34.1% | 10.8% | 8.6% | 11.3% |
| en.wikipedia.org | 225 | 4.5% | 7.4% | 7.3% | 6.1% | 6.0% | 6.3% |
| developer.mozilla.org | 115 | 38.8% | 42.7% | 50.8% | 41.0% | 41.0% | 41.5% |
| leanpub.com | 368 | 1.2% | 10.6% | 8.3% | 6.7% | 1.8% | 7.0% |
| html.spec.whatwg.org | 149 | -3.9% | 0.7% | -2.6% | 0.3% | 0.2% | 1.5% |
| stackoverflow.blog | 134 | 3.9% | 7.6% | 7.2% | 4.4% | 4.7% | 5.3% |
| edri.org | 84 | 7.4% | 13.4% | 32.3% | 12.1% | 7.8% | 12.5% |
| mastodon.social | 34 | 3.0% | 14.9% | 14.7% | 5.8% | 5.2% | 7.2% |
| home.cern | 284 | N/A | 12.7% | 25.6% | 8.1% | 4.6% | 10.0% |
| css-tricks.com | 165 | 8.5% | 16.6% | 29.6% | 14.6% | 8.6% | 15.4% |
| github.com | 555 | 3.0% | 17.4% | 16.5% | 7.3% | 5.8% | 6.4% |
| tc39.es | 7232 | 5.7% | 8.2% | 6.6% | 6.7% | 6.2% | 8.0% |
| eff.org | 53 | 8.9% | 15.8% | 11.1% | 13.5% | 11.4% | 13.4% |
| un.org | 152 | 14.2% | 22.6% | 41.3% | 20.0% | 15.2% | 17.4% |
| bbc.co.uk | 667 | 0.8% | 7.5% | 5.9% | 4.6% | 1.2% | 6.6% |
| faz.net | 1387 | 3.3% | 6.7% | 11.9% | 4.4% | 3.6% | 4.5% |
| apple.com | 284 | 6.4% | 9.6% | 8.7% | 7.7% | 6.9% | 7.3% |
| weather.com | 2284 | 0.1% | 9.3% | 9.1% | 9.2% | 0.2% | 9.3% |
| w3.org | 51 | 18.8% | 24.3% | 23.2% | 24.2% | 20.2% | 23.9% |
| lafrenchtech.gouv.fr | 157 | 13.1% | 17.6% | 62.5% | 16.8% | 13.8% | 17.3% |
| sitepoint.com | 234 | 0.7% | 10.1% | 9.6% | 6.1% | 1.0% | 5.6% |
| Avg. minify rate | 7.3% | 13.7% | 19.4% | 11.1% | 8.5% | 11.4% |
New HTML minifiers are welcome! Please submit a PR to add a new minifier to the benchmark, or open an issue to request it.
Benchmark
Run the benchmark locally:
npm install --omit=dev
npm start
After that README.md will be updated with the new benchmark data.
README.md is generated dynamically from README.template.md. So don't alter it.
Other benchmarks
- https://github.com/j9t/minifier-benchmarks โ by html-minifier-next maintainer