Back to Web development

CSS and JavaScript minifier: shrink file size online

Paste CSS or JavaScript, strip comments and extra whitespace, and see the size before and after. Strings, template literals and regular expressions are kept intact.

How to use

  1. Choose CSS or JavaScript.
  2. Paste your code into the box.
  3. Copy the minified code and test it on the page before replacing the real file.

Frequently asked questions

Does minifying make a site faster?

Yes, smaller files load faster, especially on mobile networks. How much you save depends on how many comments and spaces the code has.

Why does the JavaScript output still have line breaks?

So code without semicolons keeps working. The tool does not rename variables, so the output is safe to use straight away.

Should I keep the original?

Yes. Always keep the unminified version for later edits and only upload the minified one.