HTML Minify
Shrink HTML to a smaller version.
Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.
HTML Minify
How to use this tool
- Enter your values in the fields above.
- Press Generate to see the result.
- Use Load sample to try the worked example, Copy result to copy it, or Clear to start again.
Worked example
The sample “<div> <p> Hello </p> </div>” (with line breaks) minifies to “<div><p> Hello </p></div>”, keeping the space inside the paragraph text.
What this tool does not do / Limits
This is a simple minifier. It does not rewrite attributes or guarantee identical rendering for whitespace-sensitive content such as preformatted text.
Frequently asked questions
Are comments removed?
Yes. HTML comments are stripped from the output.
Is text inside tags changed?
Only whitespace between tags is collapsed. Spaces inside text are kept.
Related tools
JSON Studio
Format, validate, minify, query and compare JSON in your browser, with precise line-and-column errors.
LiveRegex Tester
Test patterns against sample text with match highlighting, capture groups and a safe one-second timeout.
LiveSecurity Header and DNS Checker
Check HSTS, CSP and other security headers, TLS details, and DNS/email authentication records (SPF, DKIM, DMARC).
Live