DEVELOPER TOOL · PRIVATE
HTML Minifier Online
Remove comments and unnecessary whitespace from HTML.
Compact ordinary HTML markup for smaller snippets and prototypes. Paste the input, make the change, then read the result before you copy it elsewhere.
Use a build tool for production applications.
Ready — input is processed locally.
This utility runs on the current device for the supported workflow. Kaazo does not need the pasted input to calculate the result.
What HTML Minifier does — and what it doesn’t
Compact ordinary HTML markup for smaller snippets and prototypes.
Minification should change size, not meaning
Removing whitespace and comments is useful only while the output still parses the same way. Strings, regular expressions and significant whitespace are exactly where simplistic minifiers can go wrong.
Use a build tool for production applications.
Don’t ask HTML Minifier to do a different job
Use a production build tool when you need advanced JavaScript/CSS optimisation, bundling, source maps or compatibility transforms.
Example and result checks
For a short landing-page snippet, compare the visible page before and after compaction. The result should retain attributes, links and text exactly as intended; reducing the number of bytes is useful only if the page still behaves correctly. Pay special attention to whitespace inside preformatted blocks and between inline elements.
HTML compaction is not a security filter or a validator. It will not repair inaccessible forms, broken images or unsafe third-party scripts. For an application containing templates, framework syntax or inline scripts, use its official build pipeline and regression tests rather than assuming a generic snippet minifier is production-safe.
FAQ
What does HTML Minifier actually do?
Compact ordinary HTML markup for smaller snippets and prototypes.
What is the easy mistake to make here?
Removing whitespace and comments is useful only while the output still parses the same way. Strings, regular expressions and significant whitespace are exactly where simplistic minifiers can go wrong. Use a build tool for production applications.
Does formatted or converted output prove the data is valid for my application?
No. HTML Minifier can perform the syntax or data operation described here, but your application can still impose its own schema, business rules, encoding or security requirements.
Related tools
After HTML Minifier, validate the output before feeding it into another transform. The data-format guide has broader context if you need it.