Minifying JavaScript makes scripts smaller without changing what they do: whitespace and comments go, expressions are simplified, dead code is dropped and, with Shorten variable names on, local names become single letters. Less code means faster downloads and faster parsing.
This uses terser, the minifier behind webpack, Vite and most build tools, with its default safe settings. Global names and object properties are never renamed. A syntax error is reported with its line and column instead of producing broken output. The sizes above include the gzip size that servers actually send.
Everything runs in your browser: your code is never uploaded. To make minified code readable again, use the JS Formatter .
No. Minification only makes code smaller; it can be formatted back into readable code. Shortened local names make it harder to read but are not a protection.
Terser's defaults are safe for valid JavaScript. Code that relies on function or variable names at runtime, such as reading fn.name, can change when names are shortened; turn that option off for it.
Yes. Terser parses current syntax, including classes, async functions, optional chaining and modules. It does not transpile, so the output runs in the same browsers as the input.