JavaScript Minifier
Minify JavaScript the safe way: a token-based minifier that removes comments and unnecessary whitespace while leaving strings, template literals and regular expressions perfectly intact.
- 100% Free
- No Registration
- Works in Your Browser
This tool's workspace loads here.
How to Use
- Paste your JavaScript into the input box.
- Click Minify JavaScript.
- Check the size saving.
- Copy the minified code.
About This Tool
Minify JavaScript the safe way: a token-based minifier that removes comments and unnecessary whitespace while leaving strings, template literals and regular expressions perfectly intact. Semicolons are kept — slightly less aggressive than industrial minifiers, and always safe.
Frequently Asked Questions
Why is the saving smaller than some minifiers?
Industrial minifiers also rename variables and drop semicolons, which can break code in rare cases. This one only removes comments and whitespace — smaller savings, zero surprises.
Is my code uploaded?
No. Minifying happens in your browser.
Does it handle modern syntax?
Yes — the tokenizer understands template literals, arrow functions, classes, optional chaining and regex literals.