Why minify HTML
Minifying removes comments and needless whitespace, which makes the file smaller and the page load a little faster.
What it removes
- HTML comments
- Whitespace between tags
- Runs of repeated spaces
The visible result does not change, because browsers ignore that whitespace anyway. Keep a readable copy as your source, and minify only the version you deploy.
Frequently asked questions
Will it break my page?
It only removes whitespace and comments, which browsers ignore. Keep a backup copy regardless.
Does it minify JavaScript and CSS inside the HTML?
No, it works on the HTML markup only.
Is my code uploaded?
No, everything runs in your browser.