JavaScript Minifier Online
Strip comments, whitespace and line breaks out of JavaScript to cut the bytes a browser has to download, without touching what the code does.
Output
How to use
- Paste the JavaScript you want smaller.
- The minified output appears alongside.
- Copy the compressed code.
Frequently asked questions
How much smaller does it get?
Comments and indentation usually account for a third of a readable source file, and gzip on top of minification does most of the remaining work.
Does minifying change behaviour?
It should not. Whitespace and comments carry no meaning in JavaScript, so the minified code runs the same. Test the output before it ships regardless.
Should I minify by hand or in the build?
In the build. A one-off paste is fine for a snippet, but anything that ships needs to be minified from source every time rather than maintained in two forms.
What about source maps?
Not produced here. A build tool generates them, and you want one for anything you will need to debug in production.
Last updated
Powered by maratool