JavaScript Minifier
Minify and compress JavaScript with Terser: remove whitespace and comments, shorten variable names and see the size saved.
Tool
Was this tool useful?
About this tool
About JavaScript Minifier
Use the same engine many build tools use to shrink JavaScript for production. Syntax errors are reported with the line number.
How it works
Powered by Terser (compress + mangle). Mangling renames local variables only; global names are kept.
Example
A 40 KB script with comments typically becomes 15–20 KB.
How to use this tool
- Paste your JavaScript.
- Choose whether to mangle names and keep comments with licenses.
- Click Minify and copy the result.
Frequently asked questions
Is my code uploaded?
No. Everything runs in your browser, so your code and data stay on your device.
Will it support modern JavaScript?
Yes, Terser understands modern syntax including classes, async/await and modules.
Does the JavaScript Minifier send my data to a server?
No. The JavaScript Minifier runs entirely in your browser using JavaScript, so tokens, code and data you paste stay on your device. You can even use it offline once the page has loaded.