Skip to content
Toolbrik

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

Paste your CSS to minify it.

How to use: Minifier

  1. 1Pick the code type: CSS or JavaScript.
  2. 2Paste the code.
  3. 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).

Was "Minifier" useful?

Share it with whoever needs it. It's free and stores no data.