Minify HTML with configurable optimization presets. Free, private, runs in your browser.
100% private — your files never leave your browser. All processing happens locally on your device.
HTML minification reduces the size of HTML documents by removing comments, collapsing whitespace, removing optional closing tags, shortening boolean attributes (checked='checked' → checked), removing redundant type attributes (type='text/javascript'), and collapsing whitespace between tags. These optimizations reduce the initial HTML payload that browsers download, improving page load times.
While HTML files are typically smaller than CSS or JavaScript, they are the first resource browsers download — the HTML document kicks off the entire page load waterfall. A smaller HTML document means faster Time to First Byte (TTFB) and earlier discovery of CSS, JavaScript, and image resources. For server-rendered pages, CMS templates, and email HTML, minification can reduce document size by 10-30%.
The tool uses a lightweight, custom-built minifier that processes HTML entirely in your browser. It offers two presets: Safe (removes comments, collapses whitespace, shortens doctype) and Aggressive (additionally removes between-tag whitespace, collapses boolean attributes, and strips redundant attributes). Content inside pre, code, textarea, script, and style tags is always preserved exactly as-is.
Absolutely. All processing happens locally in your browser — no HTML is sent to any server. This is safe for CMS templates, email HTML, and any markup you want to keep private.
Safe mode removes comments, collapses whitespace, and shortens the doctype. Aggressive mode also removes between-tag whitespace, collapses boolean attributes, and strips redundant attributes for maximum compression.
Yes. Content inside <pre>, <code>, <textarea>, <script>, and <style> tags is preserved exactly as-is, even in Aggressive mode.
Typically 10-30% size reduction, depending on the amount of whitespace and comments in the source. Pages with lots of indentation see larger savings.
Yes. All processing happens locally in your browser. Your HTML never leaves your device.