HTML Minifier

Remove whitespace, comments, and redundant attributes from HTML to reduce file size.
Original: bytes Minified: bytes Saved:
Paste your HTML or upload a file, then click Minify
Minified
Minified HTML appears here
Tips: Paste your HTML, choose which optimizations to apply, then click Minify. The savings badge shows how much file size was reduced. Use Copy to grab the result.

Features

  • Remove Comments: Strips all HTML comments to reduce file size.
  • Collapse Whitespace: Removes unnecessary spaces, tabs, and newlines between tags.
  • Remove Empty Attributes: Removes attributes with empty string values.
  • Shorten Boolean Attributes: Converts checked="checked" to just checked.
  • File Upload: Upload an .html file directly for instant minification.
  • Size Savings: Shows original size, minified size, and percentage saved.
  • Syntax Highlighting: Both editors use color-coded HTML for readability.

How to Use

  1. Paste or Upload: Paste HTML into the input editor or click "Upload .html" to load a file.
  2. Choose Options: Select which minification steps to apply.
  3. Minify: Click the "Minify" button to compress your HTML.
  4. Review Savings: The badges show original size, minified size, and % saved.
  5. Copy: Click "Copy" to copy the minified HTML to your clipboard.