Runs in your browser
JavaScript Minifier
Shrink JavaScript with Terser, the same AST-based minifier used by webpack and most modern build tools. Your code is parsed and transformed, never executed — no eval(), no Function() constructor.
ReadyMinifiersFree · No account required
Related tools
Features
- Real AST-based minification with Terser — never regex or eval()
- Renames local variables, removes dead code and whitespace
- Shows original size, minified size, and percentage reduction
How to use
- Paste your JavaScript into the input.
- Click Minify.
- Copy or download the minified result.
FAQ
- Is my code executed to minify it?
- No — Terser parses your code into an AST and transforms that, the same approach used by webpack and other production build tools. It never uses eval() or the Function() constructor, and never runs your code.
- Why not just strip whitespace with a regex?
- A regex can't safely tell code from a string literal or comment that happens to contain the same characters, and it can't rename variables or remove dead code. A real parser can do all of that correctly.