HTML Minifier / Pretty-Print

Strip comments, collapse whitespace, drop optional closing tags (</html>, </head>, </body>), and drop default or boolean attribute values. Toggle any option off, see live byte savings, and copy the minified result. Pretty-print mode is the inverse — re-introduce indentation on every block-level tag. Pure client-side, no upload.

Options
Summary

Paste some HTML to see the savings.

What gets stripped

  • Comments. <!-- … --> is removed entirely. Conditional comments (<!--[if IE]>) are preserved so legacy IE pages still work.
  • Optional closing tags. </html>, </head>, </body> are dropped when not followed by a comment.
  • Default attribute values. type="text" on <input>, type="submit" on <button>, method="get" on <form>, enctype="application/x-www-form-urlencoded", type="text/javascript" and type="text/css" — all gone.
  • Boolean attributes. checked="checked"checked, disabled=""disabled, and value="false" is dropped entirely.
  • Whitespace. Runs collapse to a single space; whitespace between tags is trimmed. Inside <pre>, <script>, <style>, <textarea>, and <title> it's left exactly as written — those bodies are user content.