Compress JavaScript with Terser — dead-code elimination, name mangling and expression folding.
Ctrl + Enter to run
This runs Terser, which renames local variables, removes unreachable branches and collapses expressions. Stripping whitespace alone typically saves 20 to 30 percent; Terser on the same file usually saves 60 or more, and the difference is entirely the transformations whitespace removal cannot safely attempt.
Those savings survive compression, unlike whitespace, and they reduce parse time in the browser as well as bytes on the wire. Test the output if your code relies on function or constructor names, since renaming breaks reflection-based libraries in ways that only appear at runtime.