How HTML Minifier Works
The minifier removes HTML comments, deletes text nodes that contain only whitespace (the indentation between tags), and collapses remaining runs of whitespace inside text content down to a single space. Content inside <script> and <style> tags is left as-is so embedded code isn't affected.
How to Use This Tool
- Paste your HTML into the input box.
- Select Minify HTML.
- Copy the compact output and check the size reduction shown below it.
Example
Input:
<div> <h2>Title</h2> <!-- note --> <p>Text</p> </div>
Minified output: <div><h2>Title</h2><p>Text</p></div>
Helpful Tips
- Keep the original, readable HTML in your source files — minify only the copy you actually deploy.
- Because whitespace-only text between tags is removed, minified output can slightly change spacing between inline elements — check the page visually after minifying if you use a lot of inline elements.
Frequently Asked Questions
Could minifying change how my page looks?
Block-level markup is unaffected. Spacing between inline elements (like or sitting next to each other) can occasionally shift slightly, since whitespace-only text between tags is removed — worth a quick visual check for text-heavy inline layouts.
Does it minify the CSS and JavaScript on the page too?
No, content inside <script> and <style> tags is left untouched — use the CSS Minifier or JavaScript Minifier for those separately.
Is my HTML uploaded anywhere?
No, minifying happens entirely in your browser.
This tool runs entirely in your browser. Your input is not uploaded to any server.