JavaScript minifier
Minify and compress JavaScript code with Terser: it removes spaces and comments and shortens variable names, showing the byte savings.
How to usePaste the JavaScript to minify.
JavaScript minifier: what it is for
Paste JavaScript code to compress it with Terser, the same minifier used by Webpack and Vite. Choose whether to shorten variable names and optimize the code, and see the byte savings. Syntax errors appear with the line and column.
The code isn't sent to any server: everything happens in your browser.
How to use
- Paste the JavaScript.
- Choose the compression options.
- Copy the minified code.
When to use it
- Making website scripts lighter.
- Preparing bookmarklets.
- Testing how much a file can shrink.
Frequently asked questions
Does the code still work the same?
Yes. Terser, used by tools like Webpack and Vite, only removes what doesn't change behavior and shortens local names. Global names and object properties aren't changed.
Does it support modern JavaScript?
It supports ES2020+ and modules: arrow functions, classes, async/await, import and export. Syntax errors are shown with the line and column.
Is it really free?
Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.