About HTML Minifier
An HTML minifier trims what browsers don't need from a page: comments, indentation and the space around tags. Use it before you publish a static page, paste a snippet into a CMS field or an ad slot with a size limit, or send out an HTML email template. Paste the code or open a file, and the minified version appears as you type, with the size before and after and the percentage saved.
Comments are removed, except IE conditional comments, which older templates still rely on. Runs of whitespace shrink to one space, the space around block tags such as div and p goes, and one space stays between inline elements. Text in pre and textarea is left alone. Inline CSS and JavaScript are minified too, by the same safe rules as our CSS and JavaScript minifiers; untick Also minify inline CSS and JavaScript to leave them as written. Gzip or Brotli on your server saves more on top, and the GZIP and Brotli Checker shows whether it's on. Nothing is uploaded.
How to use HTML Minifier
- 1Paste the HTML
Paste the code into the box or open an HTML file.
- 2Keep or skip inline code
Also minify inline CSS and JavaScript is on, so untick it to leave script and style blocks as they are.
- 3Check the savings
The HTML minifier shows the result live, with the size before and after.
- 4Copy or download
Copy the minified HTML or download it as a file.
Why use Cubfile for this
- Comments removed
HTML comments are removed, while IE conditional comments stay.
- Whitespace collapsed
Indentation and line breaks go, pre and textarea keep their spacing, and inline elements keep the space between them.
- Inline CSS and JS too
Style and script blocks are minified with the same safe rules, or left as written if you untick the option.
- Size saved
See the size before and after and the percentage saved before you copy.