HTML Minifier
Paste HTML, choose the cleanup rules you need, and get a compact document locally without uploading your source.
A QUICK WALKTHROUGH
How to use this tool
- Paste HTML up to 200,000 characters and choose which safe formatting details to remove.
- Select Minify HTML to normalize markup while preserving text in pre, textarea, script, and style elements.
- Review the compact output, copy it, or download it as an HTML file.
Focused, browser-only cleanup
The minifier removes HTML comments unless they are conditional comments, collapses formatting whitespace between tags, and normalizes spacing around attributes. Your source remains in this browser and is never sent to a server.
Content boundaries stay protected
Text inside pre, textarea, script, and style elements is kept as entered. The minifier does not parse, rewrite, or reorder attributes, CSS, JavaScript, URLs, entities, or visible text.
Review output before shipping
Whitespace can be meaningful in inline HTML and some template languages. Check the result in your target page, especially when your source intentionally uses spaces between inline elements or server-side directives.
GOOD TO KNOW
Common questions
Does minifying HTML change visible text?
Text inside protected elements is kept exactly. Outside them, whitespace between tags is removed and runs of formatting whitespace are reduced to one space, so review inline text where spaces matter.
Are conditional comments removed?
No. Comments beginning with [if or ending with [endif] are preserved because they can control legacy browser behavior.
Is my HTML uploaded?
No. Minification, copying, and download preparation happen locally in your browser.
Does this validate HTML?
No. It performs a focused text transformation and does not replace an HTML validator or browser compatibility check.