HTML Minifier

Strip comments and redundant whitespace from HTML to cut page weight, keeping one meaningful space between inline elements and preformatted text.

An HTML minifier removes the whitespace and comments a browser does not need, which lowers the size you send over the wire. Content inside pre and textarea is left alone because it is significant there.

Output

                

Paste or type something above.

Questions about html minifier

Does it remove comments?
Yes, unless you turn on keeping comments. Conditional comments and licence headers are worth keeping for production builds.
Will it break inline layout?
A single space is preserved between inline elements so words do not run together, while indentation whitespace is removed.
Does it minify inline CSS and JavaScript?
No. That needs a build step or a dedicated asset minifier, because both have rules a text pass cannot guess.