Minify your HTML

Online HTML Minifier/Compressor. Free! Provides an API. Simple Quick and Fast.


Support HTML Minifier by purchasing a w3tees t-shirt. This site is also run by us.


Thanks to Jeremy Cron for contributing this example.

require "rest_client"

task :minify do
  html_file = "index.html"
  html_min_file = "html/index.html"
  response = "", {:input =>}, "w").write(response)

Language Examples

Click on the language of your choice:

wget Curl Node.js Python Ruby Perl PHP C#

More Languages

I'd love to add more examples in your favourite programming language, so feel free to send them my way. Email andychilton at that gmail place in the sky or tweet to me @andychilton.