All tools › For Developers
Minify and Format HTML, CSS and JavaScript
Strip the unneeded from code for publishing or, conversely, add indentation. We show the size before and after, including after gzip.
What the tool can do
- Minifying HTML, CSS and JS: comments, whitespace, extra zeros and repeated colors are removed; the code works the same.
- For JavaScript the result is checked by the browser: if the source parses but the minified code does not, you will see a warning.
- Strings, template literals, regular expressions and code without semicolons are handled correctly.
- Showing the size “before → after” and the size after gzip, that is, the real traffic savings.
- Formatting: tidy indentation for HTML, CSS and JS; the contents of pre and textarea are not changed.
- The code type is detected automatically on paste or from the file extension.
Variables are not renamed, so JS shrinks less than in Terser, but the behavior of the code does not change. For large projects use a bundler; for scripts and pages this is enough.