How to use the JavaScript Minifier
- Paste your JavaScript
- Click Minify
- Copy or download the .min.js output and check the size saved
About this tool
This tool loads Terser (BSD-licensed), the minifier behind webpack, Vite and Rollup production builds. It removes whitespace and comments, renames local variables to short names (mangling), and applies safe compressions such as dead-code removal and constant folding. Comments starting with /*! or containing @license are kept.
If your code has a syntax error, you get Terser’s message with the line and column. Terser is about 1 MB, so it is loaded only when you first click Minify.
Frequently asked questions
Does it support ES modules and modern syntax?
Yes. Terser parses ES2020+ syntax, including classes, arrow functions, async/await, optional chaining and import/export.
Will mangling break my code?
Only local names are mangled. Global variables and object properties keep their names, so code that other scripts call still works.
Is my code uploaded?
No. Terser runs in your browser, so proprietary code stays private.
Related tools
Updated · Built and maintained by the UtilityBright team · About our tools · Report a problem