HTML Minifier / Optimizer
Shrink HTML by stripping comments, collapsing whitespace, and minifying inline CSS/JS — with a live savings summary.
About this tool
The HTML Minifier reduces the byte size of your HTML by stripping non-essential content: HTML comments, redundant whitespace between tags, and — optionally — closing tags the HTML5 spec allows browsers to infer (like a trailing </li> before the next <li>). Every optimization is a toggle, so you control exactly how aggressive the minification is.
Unlike the HTML Formatter (which reflows HTML for readability), this tool is purpose-built for production: smaller HTML means faster time-to-first-byte, less bandwidth on mobile connections, and lower CDN egress costs. IE conditional comments (<!--[if IE]>...<![endif]-->) are automatically preserved even when "Remove comments" is enabled, since stripping them would change page behavior in legacy browsers still relying on them.
Two additional toggles handle inline assets: "Minify inline <style>" collapses whitespace inside <style> blocks, and "Minify inline <script>" strips comments and extra whitespace from inline <script> tags (not external files, and not a full JS minifier — for that, use the JavaScript Minifier tool, which uses terser for real compression and mangling).
The output panel shows a live "Saved X% · A KB → B KB" summary so you can see the exact impact of each toggle. All processing runs entirely in your browser with a custom, dependency-free minification routine — no third-party library, no network request, no server ever sees your markup.
