JavaScript minifier and beautifier
Compress your JS by stripping comments and whitespace and shortening names, or format a minified script so it is readable. Powered by Terser, right in your browser.
Processed 100% in your browser
How can I verify this?
Your files are never uploaded: they are processed on your device. Don’t take our word for it: load the page, go offline and the tool keeps working. Or open your browser’s developer tools (F12), go to the Network tab, and see that no file leaves your device.
Ctrl + Enter runCtrl + C copy result
How to use
- 1Paste your JavaScript code.
- 2Choose Minify or Beautify.
- 3When minifying, decide whether to shorten variable names.
- 4Copy or download the result.
Use cases
- Reduce a script’s weight before publishing it.
- Read a .min.js file to understand what it does.
- Quickly check whether a snippet has syntax errors.
- Save bandwidth on small pages without setting up a bundler.
Frequently asked questions
Is it safe to minify with shortened names?
Usually yes, but if your code reaches variables by name (for example via eval or from HTML), turn that option off.
Is my code uploaded to a server?
No. Terser runs in your browser.
Are comments kept?
They are removed when minifying and kept when beautifying.
Does it support modern JavaScript?
Yes, ES2015 and later syntax such as async/await, classes and modules.