CSS and JavaScript Minifier
Reduce the size of your stylesheets and scripts by removing unnecessary comments, spaces and line breaks. The minifier is conservative and safe: it preserves strings, template literals and regular expressions, and respects the line breaks JavaScript needs.
Settings
For JavaScript, unnecessary comments and whitespace are removed without breaking the code: strings, template literals and regular expressions are preserved. Everything is processed in your browser.
Minified code
How to use: Minifier
- 1Pick the code type: CSS or JavaScript.
- 2Paste the code.
- 3Copy or download the minified code and see how much you saved.
What is it for?
- Reduce file size so your site loads faster.
- Prepare snippets to paste into templates.
- Compress code without setting up a build system.
Minifying CSS and JavaScript
What it removes
Spaces, line breaks and comments. Advanced minifiers also shorten local variable names and simplify expressions; this tool applies safe minification.
Real savings
It usually cuts size by 20 % to 60 %, although server gzip or brotli compression already captures much of the benefit. They combine.
Keep the original
Always keep readable source code and minify only for production; debugging minified code is very hard without source maps.
Related tools
Frequently asked questions
Why doesn't it minify as aggressively as terser?+
It prioritizes not breaking your code: it safely minifies comments and whitespace without changing meaning. That's enough for 99% of use cases.
Does it respect automatic semicolon insertion?+
Yes. In JavaScript, line breaks between statements are preserved so ASI isn't altered (e.g. after return or throw).

