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 justchecked. - 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
- Paste or Upload: Paste HTML into the input editor or click "Upload .html" to load a file.
- Choose Options: Select which minification steps to apply.
- Minify: Click the "Minify" button to compress your HTML.
- Review Savings: The badges show original size, minified size, and % saved.
- Copy: Click "Copy" to copy the minified HTML to your clipboard.