HTML Minifier
Paste HTML to strip comments and collapse whitespace between tags, while leaving the content of <script>, <style>, <pre> and <textarea> untouched.
221 → 149 characters (-33%)
Content inside <script>, <style>, <pre> and <textarea> tags is left untouched.
Frequently asked questions
Will this break my JavaScript or CSS?+
No, the contents of <script> and <style> tags are protected and passed through unchanged, since minifying them safely requires a full JS/CSS parser.
Does it minify attribute values?+
No, tag attributes are copied through byte-for-byte; only whitespace between tags in the surrounding text is collapsed.
Why keep whitespace inside <pre> tags?+
Because whitespace inside <pre> and <textarea> is meaningful to how the browser displays it, so altering it would change the visible output.