Shrink HTML safely: strip comments and redundant whitespace, drop default type attributes and quotes — script, style and pre stay untouched.
Minification happens locally in your browser. Your HTML never leaves your device.
The page is scanned once, separating raw regions (script, style, textarea and pre blocks pass through byte-for-byte) from ordinary markup. In markup, comments are dropped unless they are conditional, whitespace is collapsed, and — if enabled — attribute quotes that carry no risk come off and redundant default type attributes disappear. The transformations below are the whole list; nothing else is attempted.
class="box": safe by HTML5 rules. Those three run here. Removing optional end tags (</p>, </li>) is deliberately NOT offered: browsers re-infer structure from context, and one misjudged nesting turns a layout upside down for a few bytes.No. Script and style contents pass through byte-for-byte untouched. Real JS minification means parsing the language and renaming variables, which can change program behavior if done wrong — that is a different job with different tooling. Our sibling Code Minifier tool on this site does exactly that as a separate page.
Also untouched. Rebuilding CSS (merging rules, shortening colors) can alter cascade order in edge cases, so this tool leaves every style block and style attribute as written. Only the whitespace between HTML tags and in the markup itself is processed.
Ordinary HTML comments are dead weight in production, so they go by default. But legacy conditional comments — <!--[if IE]> ... <![endif]--> — are executable instructions for old Internet Explorer, and deleting them can change what those browsers render. The Keep conditional comments toggle preserves exactly that family of comments.
Typical hand-written or template-generated HTML sheds roughly 5–15%: mostly indentation whitespace and comments. Minification frameworks that also shrink JS and CSS report bigger numbers, but they are doing more dangerous work. Check the stats line — if the gain is small on your file, the safe mode kept you out of trouble for nothing.
No. The whole transformation is a regex-pass over your text in plain JavaScript inside the browser. Nothing is sent anywhere, and there is no account or network request attached to minifying.
If you just finished with HTML Minifier, the natural next steps are Code Minifier, Regular Expression Tester, Text Diff, or browse every tool in Privacy File Tools.