HTML minification collapses whitespace and removes comments to reduce page weight. It also minifies the inline CSS, JavaScript and JSON blocks inside the document, then reports the size saved.
Common uses
- Tidying a snippet before pasting it into a pull request or ticket
- Shrinking CSS or JavaScript for a quick size check
- Making a one-line SQL query from a log readable
Frequently asked questions
- Does it break whitespace-sensitive content?
- Content inside pre and textarea elements is preserved. Inline text spacing can still change slightly, so review the result.
- Are inline scripts minified too?
- Yes, inline CSS, JavaScript and JSON are minified along with the markup.