Make JavaScript smaller without changing what it does.
Loading tool…
The minifier uses Terser, the minifier behind most JavaScript build tools. It parses your code, removes whitespace and comments, simplifies expressions and can shorten local variable names, then prints the smallest equivalent program. Because it works on the parsed code rather than on text, strings, URLs and regular expressions are never damaged. Licence comments (/*! ... */ and @license) are kept.
Minify a script without setting up a build tool.
Get code small enough to embed or share.
See how much a script would shrink before adding minification to a build.
Yes. Terser only applies transformations that keep the program's behaviour, so the output does the same as the input.
It renames local variables and function parameters to short names like a and b. Global names and object properties stay as they are, so other code can still use them.
If your file uses import or export. Module code is parsed in strict mode and top-level names can be shortened too.
Yes. Comments starting with /*! or containing @license or @preserve are kept; all other comments are removed.
No. Everything runs in your browser; nothing you paste or upload is sent to our servers.