JS minifier

Minify and improve the performance of JS code.

  • Development
  • 100% free
  • No sign-up
  • Runs in your browser
JS minifier

What is the js minifier?

The JS minifier compresses JavaScript by removing whitespace, comments and dead code, and by shortening local variable names. It uses the Terser engine, the same one used by most modern build tools, and runs entirely in your browser.

Smaller scripts download and parse faster, which improves page speed metrics such as Largest Contentful Paint and Interaction to Next Paint. Minify your code before deploying, and keep the original version for development.

How to use the js minifier

  1. 1Paste your JavaScript code.
  2. 2Press Minify to compress it.
  3. 3Copy the minified code, or fix the syntax error that's reported.

Features

Terser powered

Reliable, production grade minification and mangling.

Syntax errors

Invalid code is reported with its line and column.

Private

Your code never leaves your browser.

One click copy

Copy the result straight to your clipboard.

Frequently asked questions

Does minifying change how my code works?

No. Minification keeps the behavior of the code, it only makes it smaller.

How much smaller will my code get?

Typically 30% to 60%, and even more once the server compresses it with gzip or Brotli.

Is my code uploaded?

No, the minification runs locally in your browser.

Should I minify in production only?

Yes. Keep readable source code for development, and serve the minified version to visitors.