Minifiers
HTML Minifier
Every comment, indent and blank line in HTML is sent to every visitor. The HTML Minifier strips comments and collapses whitespace between tags to reduce page weight without changing what the browser renders.
It is ideal for small static pages, email templates and HTML snippets embedded in other systems.
How to use the HTML Minifier
- 1Use the HTML Minifier right on this page, or open the full workspace for history, sharing and every other tool.
- 2Paste your input, upload a file, or drag and drop a file onto the input box (up to 25 MB).
- 3The result appears in the output panel automatically and updates when you change the input or an option.
- 4Use Copy Output or Download to save the result. Nothing is uploaded to a server.
Example
Comments are removed and the indented markup collapses into a single line.
Input
<div> <!-- hi --> <p>Hello</p> </div>
Output
<div><p>Hello</p></div>
When to use it
- Shrinking a landing page or static template before deployment
- Preparing compact HTML for email platforms with size limits
- Embedding HTML snippets in JSON or JavaScript strings
Tips and common mistakes
- Keep your original formatted file — minified HTML is hard to edit.
- Content inside <pre> blocks relies on whitespace; review it after minifying.
- Combine with the CSS and JavaScript minifiers for inline styles and scripts.
Frequently asked questions
Will my page look different?
Normally no. Whitespace between block elements does not affect rendering, but inline elements can lose a visible space in rare cases.
Does it minify inline CSS and JS?
It focuses on markup. Use the CSS and JavaScript minifiers for those parts.