EN
PortuguêsEnglishEspañol
All tools
Developer tools 100% free

JavaScript minifier

Minify and compress JavaScript code with Terser: it removes spaces and comments and shortens variable names, showing the byte savings.

How to use

Thank you so much for helping!

Every donation helps pay for the servers and keeps the tools free for everyone. Pick or type an amount:

Secure payment by Stripe. Opens in a new tab.

Back to Format and convert

Paste the JavaScript to minify.

Available in: PortuguêsEspañolEnglish

Advertisement

JavaScript minifier: what it is for

Paste JavaScript code to compress it with Terser, the same minifier used by Webpack and Vite. Choose whether to shorten variable names and optimize the code, and see the byte savings. Syntax errors appear with the line and column.

The code isn't sent to any server: everything happens in your browser.

How to use

  1. Paste the JavaScript.
  2. Choose the compression options.
  3. Copy the minified code.

When to use it

  • Making website scripts lighter.
  • Preparing bookmarklets.
  • Testing how much a file can shrink.

Frequently asked questions

Does the code still work the same?

Yes. Terser, used by tools like Webpack and Vite, only removes what doesn't change behavior and shortens local names. Global names and object properties aren't changed.

Does it support modern JavaScript?

It supports ES2020+ and modules: arrow functions, classes, async/await, import and export. Syntax errors are shown with the line and column.

Is it really free?

Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.

Similar tools

The tools are provided as is, without warranty. We are not responsible for the results or for how they are used.