CSS & JavaScript Minifier

Minify JavaScript with Terser and CSS with a safe whitespace and comment remover, and see how many bytes and percent you save.

Runs on your device

Result

Results appear here after you select “Minify”.

What it does

Smaller files load faster. JavaScript is parsed and compressed by Terser, the minifier used by most build tools; CSS has comments and unnecessary whitespace removed.

How to use it

  1. Choose JavaScript or CSS.
  2. Paste the code.
  3. Copy or download the minified output.

Example

The example fills in realistic values and runs the tool. Select Try an example above to see it.

When it helps

  • Quick fixes on sites without a build step.
  • Inline scripts in email templates.
  • Measuring how much minification saves.

Questions

Is it safe for any JavaScript?

Terser preserves behaviour for valid code. Syntax errors are reported instead of producing broken output.

Does the CSS minifier rename classes?

No. It only removes comments and whitespace and shortens zero units.

More developer tools

See all 25

People also use

Browse all 200 tools