JavaScript Minifier
Minify and compress JavaScript safely with Terser.
About the JavaScript Minifier
JavaScript is usually the most expensive resource on a page: it has to be downloaded, parsed, compiled and run, often on a slow phone CPU. Minification makes files smaller by removing whitespace and comments, simplifying code and optionally shortening local variable names.
This tool uses Terser, the same minifier used by most modern build tools, so the output is safe and standards-compliant (including modern ES syntax). Licence comments marked /*!, @license or @preserve are kept.
Frequently asked questions
What does “shorten variable names” do?
It renames local variables and function parameters to short names like a, b, c. Global names and object properties are left alone, so behaviour is unchanged.
Is minified code harder to debug?
Yes. Keep the original for development and use source maps in your build pipeline if you need to debug production code.
Does minification replace removing unused code?
No. The biggest JavaScript wins usually come from removing libraries and features you do not use, and deferring scripts that are not needed immediately.