Back to Tools
HTML Minifier
HTML Minifier
Compress your HTML by removing whitespace, comments, and empty lines
0
0
0%
1
About the HTML Minifier
Reduce the size of HTML by removing comments and extra whitespace. Smaller pages download and render faster.
How to use the HTML Minifier
- Paste your HTML or press Load Sample.
- Tick Remove Comments and Collapse Whitespace.
- Press Minify HTML Now and compare Original, Minified and Savings. Then Copy or Download.
When to use the HTML Minifier
- Reducing the size of static HTML pages and email templates.
- Cleaning up whitespace before embedding HTML in another file.
- Speeding up page loads a little.
Common mistakes to avoid
- Removing whitespace that matters inside pre-formatted blocks.
- Minifying your only copy. Keep the original for editing.
Tips
- Whitespace inside pre and textarea elements is significant, so check those areas after minifying.
- Keep conditional comments if you support very old browsers.
Frequently Asked Questions
Typically 10 to 30 percent of the HTML size, depending on how much whitespace and how many comments the file contains.
Usually 10% to 30%. Server compression such as gzip or Brotli gives a much larger saving on top of this.