HTML Minifier
Minify HTML locally by removing comments and extra whitespace.
Embed this tool
Copy the iframe code below to add this tool to your site. The embed loads HTML Minifier without ads.
Embed code copied to clipboard.
Tool workspace
Minify HTML in your browser by removing comments and extra whitespace. Contents of script, style, pre, textarea, and code are preserved. Markup is not executed or uploaded. Not a bundler-equivalent build step.
How it works
Minification runs entirely in your browser: HTML comments and unnecessary whitespace are removed while the contents of script, style, pre, textarea, and code blocks stay intact. Markup is never executed, injected into the page, or uploaded.
Empty input clears the result—no error. This is not a full HTML validator or a production bundler (html-minifier-terser) equivalent.
Examples
- <div> <p>Hi</p> </div> → <div><p>Hi</p></div>
- <!-- comment --> removed
- Script / style / pre / textarea / code inner whitespace preserved
- Status shows before → after character counts when useful
Privacy
FAQ
Is my HTML uploaded?
No. Minification runs entirely in your browser. We do not log or store what you paste.
Will this match my bundler’s HTML minifier?
Not necessarily. This is a safe best-effort minifier for pasted markup, not a production build pipeline.
Do I need an account?
No. All published tools work for guests without login.