Skip to content

webketje/html-minifiers-benchmark

 
 

Repository files navigation

HTML Minifiers Benchmarks

Updated: 2026-03-01

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.6% 11.5% 34.5% 11.1% 8.7% 11.5%
developer.mozilla.org 109 37.9% 41.6% 52.7% 40.1% 40.0% 40.5%
en.wikipedia.org 227 4.4% 7.3% 7.2% 6.0% 5.9% 6.2%
css-tricks.com 153 8.9% 22.1% 26.1% 12.0% 9.0% 12.1%
stackoverflow.blog 141 3.7% 7.2% 6.8% 4.3% 4.5% 5.1%
edri.org 80 7.7% 13.7% 30.7% 12.3% 8.2% 12.8%
html.spec.whatwg.org 149 -3.9% 0.6% -2.6% 0.3% 0.2% 1.5%
leanpub.com 355 1.2% 8.3% 6.6% 4.8% 1.9% 5.2%
home.cern 151 37.1% 46.4% 40.2% 38.9% 39.5% 40.3%
lafrenchtech.gouv.fr 152 13.2% 17.8% 64.1% 16.9% 13.8% 17.5%
mastodon.social 39 3.3% 12.0% 14.3% 5.8% 5.9% 7.6%
eff.org 56 8.3% 13.9% 11.8% 12.7% 10.7% 12.6%
apple.com 225 8.6% 13.4% 11.5% 10.3% 9.5% 9.8%
un.org 150 14.3% 22.7% 41.6% 20.1% 15.2% 17.5%
w3.org 51 18.9% 24.3% 23.2% 24.2% 20.2% 23.9%
bbc.co.uk 751 0.8% 6.8% 5.9% 4.8% 1.3% 6.1%
sitepoint.com 233 0.7% 10.1% 9.7% 6.2% 1.0% 5.6%
weather.com 1089 0.2% 8.4% 7.8% 8.0% 0.6% 8.3%
github.com 548 3.0% 17.3% 16.6% 7.3% 5.8% 6.3%
faz.net 1389 3.3% 5.5% 10.5% 4.5% 3.6% 4.5%
tc39.es 7308 8.5% 11.1% 9.3% 9.4% 9.2% 10.9%
Avg. minify rate 8.9% 15.3% 20.4% 12.4% 10.2% 12.7%

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

About

Benchmark of various HTML minifiers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%