HTML Minifiers Benchmarks
August 17, 2026 ยท View on GitHub
Updated: 2026-08-17
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 | 6.9% | 11.1% | 34.4% | 10.3% | 8.1% | 11.0% |
| developer.mozilla.org | 119 | 39.1% | 42.8% | 52.8% | 41.2% | 41.1% | 41.6% |
| css-tricks.com | 12 | 7.9% | 40.5% | 36.8% | 18.5% | 8.1% | 24.8% |
| en.wikipedia.org | 252 | 4.6% | 7.6% | 7.1% | 5.9% | 6.0% | 6.3% |
| github.com | 561 | 1.4% | 15.5% | 14.8% | 5.2% | 4.0% | 4.5% |
| lafrenchtech.gouv.fr | 1 | 4.9% | 5.7% | 5.1% | 7.9% | 7.5% | 7.5% |
| edri.org | 84 | 7.4% | 12.9% | 32.3% | 12.2% | 7.9% | 12.6% |
| html.spec.whatwg.org | 151 | -3.9% | 0.6% | -2.6% | 0.3% | 0.2% | 1.5% |
| leanpub.com | 334 | 1.2% | 8.7% | 6.9% | 4.9% | 1.9% | 5.4% |
| stackoverflow.blog | 134 | 4.1% | 6.9% | 6.6% | 4.5% | 4.9% | 5.5% |
| apple.com | 248 | 6.0% | 9.6% | 8.7% | 7.6% | 6.7% | 6.9% |
| eff.org | 53 | 8.8% | 15.4% | 10.9% | 13.3% | 11.3% | 13.3% |
| home.cern | 290 | N/A | 12.9% | 23.2% | 8.1% | 4.7% | 10.2% |
| mastodon.social | 54 | 3.9% | 13.5% | 13.4% | 5.8% | 7.2% | 8.6% |
| w3.org | 50 | 19.0% | 24.5% | 23.4% | 24.4% | 20.4% | 24.1% |
| weather.com | 340 | 0.5% | 8.4% | 6.5% | 6.5% | 0.6% | 6.8% |
| bbc.co.uk | 704 | 0.8% | 7.1% | 5.9% | 4.7% | 1.2% | 6.3% |
| un.org | 154 | 14.1% | 22.1% | 41.0% | 19.8% | 15.1% | 17.3% |
| faz.net | 1585 | 3.4% | 10.7% | 15.5% | 4.6% | 3.7% | 8.6% |
| tc39.es | 7410 | 5.7% | 8.2% | 6.6% | 6.7% | 6.2% | 8.0% |
| Avg. minify rate | 7.1% | 14.3% | 17.2% | 10.8% | 8.5% | 11.6% |
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