Skip to content
toolstome

CSS and JavaScript minifier

Make your website's scripts and stylesheets smaller so pages load faster. Paste or open a JavaScript file to minify it with Terser, which removes whitespace and comments, shortens variable names and simplifies code safely, or a CSS file to optimise it with CSSO, which merges rules and shortens values. The tool shows the size before and after, keeps licence comments if you want, and points to the line and column of any syntax error.

Free · No sign-upProcessed in your browser

Language

How to use the CSS & JavaScript Minifier

  1. 1

    Choose JavaScript or CSS

    Pick the language, or open a .js or .css file and it is selected automatically.

  2. 2

    Set the options

    Keep 'Shorten variable names' on for the smallest JavaScript; keep licence comments if your licences require it.

  3. 3

    Press Minify

    The minified code and the bytes saved appear.

  4. 4

    Copy or download

    Save the result as a .min.js or .min.css file.

What minification does

For JavaScript, Terser parses the code, removes comments and whitespace, renames local variables to short names and applies safe simplifications. Global names and property names are not renamed, so the code behaves the same.

For CSS, CSSO removes whitespace and comments, shortens colours and units, and merges rules with the same selectors or declarations when that does not change the result.

  • saved % = (original − minified) ÷ original × 100
  • #ffffff → #fff, 0px → 0

When to use it

  • Prepare scripts and styles for a static website or landing page.
  • Reduce the size of a WordPress theme's custom CSS or JS.
  • Check whether a file has a syntax error.

Limits

  • Files up to 5 MB. TypeScript, JSX and Sass must be compiled first.
  • Minified code is hard to read; keep your original source.

Privacy

Minification runs in your browser in a background worker. Your code is never uploaded.

Frequently asked questions

Is minified code safe to use?

Yes. Terser and CSSO only make changes that keep behaviour the same. Test your site after minifying, as with any build step.

Should I also use gzip or Brotli?

Yes. Servers compress files when sending them; minifying first makes the compressed files smaller still.

Why is my licence comment still there?

Comments starting with /*! or containing @license are kept when 'Keep licence comments' is on, as many licences require.

Can it minify TypeScript or JSX?

No. Compile them to JavaScript first, then minify the output.

Why did I get a syntax error?

The code has a mistake, such as a missing bracket, at the line and column shown. Minifiers must parse code fully, so they catch errors browsers might report later.

Is my code uploaded?

No. It is processed in your browser.

People also use

Last updated November 20, 2026 · How we build and test our tools

Categories

Recently used tools

Tools you open will appear here.

More