HTML Minifier

Minify HTML: HTML Minifier is a free online tool to minify HTML and any JS or CSS included in your markup. HTML Minify 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.

HTML Minifier

Minify HTML and any CSS or JS included in Markup


How to Use HTML Mififier

As always, you must create a backup first before using the HTML 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 “Minify” button and wait for the HTML mnifier 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 box. Highlight the code Ctrl + A and right click then copy it. Feel free to use the quick download or copy 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.

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 60% 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.

Useful Tools

I like making useful client-side JavaScript apps. Please check out my other useful developer tools.