What gets removed
For CSS: comments, spaces around braces, colons, semicolons and commas, and the last semicolon in a block. For HTML: comments and the space between tags, while the content of pre, textarea, script and style tags is left alone. For JavaScript: comments, blank lines and extra spaces, while strings, template literals and regular expressions are never touched.
Check the result
Compare before and after with the diff checker, and format data with the JSON formatter.
Frequently asked questions
What does minifying do?
It removes comments, line breaks and spaces that browsers do not need, so files download faster. The code behaves the same.
Is this as small as a build tool like Terser?
No. Build tools also rename variables and rewrite code to save more. This tool only removes comments and whitespace, which keeps it safe for any code.
Why does the JavaScript keep some line breaks?
JavaScript can end a statement at a line break without a semicolon. Joining every line could change what the code does, so line breaks are kept and only blank lines and extra spaces go.
Should I keep an unminified copy?
Yes. Always keep the readable original and publish the minified file. Minified code is hard to edit.
Is my code uploaded?
No. Everything runs in your browser.