About the JavaScript Minifier
The JavaScript Minifier uses Terser, the industry-standard JavaScript compressor used by build tools like Webpack and Vite, running entirely in your browser. It removes whitespace and comments, shortens local variable and function names, removes dead code and applies dozens of safe optimizations.
Minified scripts are often 50–70% smaller, so they download faster, especially on mobile networks. This helps page speed scores and user experience. The tool supports modern ES2015+ syntax and reports syntax errors with line and column numbers, which also makes it a quick way to validate your code.
How to use the JavaScript Minifier
- Paste your JavaScript into the input box.
- Choose whether to shorten variable names.
- Click Minify JavaScript.
- Copy the minified code and check the size reduction.
Frequently asked questions
Will minification break my code?
Terser applies only safe transformations. Code that relies on function names at runtime may need the Shorten variable names option turned off.
Does it support ES6 and newer syntax?
Yes. Modern syntax such as arrow functions, classes, async/await and modules is fully supported.
Is my code uploaded?
No. Terser runs inside your browser, so your source code never leaves your device.
