This site has been acquired by Toptal.com.
(Attention! API endpoint has changed)

HTML Minifier

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

Curl

# minifying some HTML to stdout
curl -X POST -s --data-urlencode 'input=p { color : red; }' https://www.toptal.com/developers/html-minifier/raw

# minifying a HTML file (e.g. index.html -> html/index.html)
curl -X POST -s --data-urlencode 'input@index.html' https://www.toptal.com/developers/html-minifier/raw > html/index.html

Languages

Click on the language of your choice to see an example: