CompressHTML is a free tool to compress HTML files online. CompressHTML produces the lowest file size without breaking the code its minifying. It will compress the whole HTML page, including the JavaScript and CSS codes enclosed in script and style tags.

Why should I compress my HTML files?

There is so much room for minification in HTML, CSS and JS. Typically you can reduce the size of the file by 20% by simply removing unneccesary white spaces, line breaks and comments. Smaller file size means less bandwidth consumption, so by compressing you're not only saving up money on hosting but you're also making your site load faster.


As always, you must create a backup first before using the compressor. We are not liable for any loss or damage to your code. Also you might want to have the original copy of your HTML for future development.

  1. Paste your .html code into the "Input" box.
  2. Go to "Options" and configure the settings to your liking. Simply tick the checbox if you want to enable that specific option.
  3. Click the "Compress" button and wait for the tool to finish minifying your code. It shouldn't take more than a few seconds.
  4. If you've done it correctly, the compressed code should now appear on the right pane. Highlight the code Ctrl + A and right click then copy it. Feel free to use the quick download button if you want to save the html file directly on your computer.

Note: If you want to exclude certain part of your code from compression, simply wrap that part with <!-- htmlmin:ignore --> tag.



Select: All | None | Default