JavaScript Minifier
Minify JavaScript with Terser: shortened names, dead code removed, whitespace stripped. See the size saved. Free and runs in your browser.
On your device: nothing you enter here is uploaded.
Input
Result
The result appears here as you type.
What this tool is for
Real minification, not just whitespace removal: Terser renames local variables, drops unreachable branches and simplifies expressions. The same tool bundlers use, running locally, with a before and after size so you can see what it bought you.
How to use it
- Paste your JavaScript.
- Choose whether to mangle names and drop console calls.
- Read the size comparison and copy the minified code.
Frequently asked questions
Why is my code smaller but broken?
Almost always because something outside the file depends on a name that got mangled, or the code relies on Function.prototype.toString. Turn name mangling off and it will usually behave.