What this tool does
JavaScript Minifier uses Terser's complete parsing, compress, and mangle process. Unlike whitespace removal or regular replacement, it understands scopes, strings, regular literals, template strings, and modern syntax.
- Supports modern ECMAScript, including classes, private fields, optional chaining and other common syntax.
- Without using eval, new Function, or dynamic script, user code is never executed.
- /*! License comments are preserved and the output is downloadable as minified.js.
How to use it
- Paste the JavaScript source code.
- Click "Compress JavaScript."
- If there is a Syntax Error, correct it according to the parser message.
- View size statistics, copy or download results and run project tests.
Common uses
- Reduce the transmission size of production scripts.
- Test whether the modern grammar can be accepted by the parser.
- Generate compressed versions for simple standalone scripts.
JavaScript Minifier Features
Use Terser to parse, minify, and obfuscate modern JavaScript, and display volume changes. It is suitable for daily development, debugging, data sorting and code optimization scenarios. The processing results can be directly viewed, copied or downloaded.
FAQ
Will the tool execute my JavaScript?
No. Terser only parses and generates code, the page does not execute the input path.
Does mangle change variable names?
Local variable names are shortened after safe scope analysis; projects that rely on function name strings or reflection should be fully tested before release.
Why do some annotations still exist?
Comments starting with /*! often carry license information, and the current configuration is selected to be retained.