Code Minifiers

JavaScript Minifier

Minify modern JavaScript and shorten local variable names, with syntax errors, original size, result size, and savings shown.

Press Ctrl / ⌘ + Enter to run
Read-only result

Minify modern JavaScript and shorten local variable names, with syntax errors, original size, result size, and savings shown.

What this tool does

Minify modern JavaScript and shorten local variable names, with syntax errors, original size, result size, and savings shown.

  • Supports modern ECMAScript, including classes, private fields, optional chaining and other common syntax.
  • Your code is processed as text and is never run.
  • /*! License comments are preserved and the output is downloadable as minified.js.

How to use it

  1. Paste the JavaScript source code.
  2. Click "Compress JavaScript."
  3. If there is a Syntax Error, correct it according to the parser message.
  4. View size statistics, copy or download results and run project tests.

Common uses

  • Reduce the transmission size of production scripts.
  • Test whether the modern grammar can be accepted by the parser.
  • Generate compressed versions for simple standalone scripts.

JavaScript Minifier Features

Minify modern JavaScript and compare the original size, result size, and savings. Review the output, then copy it or download minified.js.

FAQ

Will the tool execute my JavaScript?

No. Your input is used only to produce text output; its code is not executed and no network request is sent.

Does mangle change variable names?

Yes, local variable names may be shortened. If your code relies on function-name strings or reflection, fully test the minified result before publishing.

Why do some annotations still exist?

These comments often contain license or copyright information, so they are preserved in the minified output.

Back to Developer Tools