Minify JavaScript
Remove comments, collapse whitespace, and reduce file size. All processing happens in your browser using the Terser engine.
JavaScript Minifier
Paste any JavaScript code to minify it. Comments and extra whitespace will be removed.
Ready to minify
Enter your JavaScript code above and click Minify to see compression results and savings.
What this tool does not do
- Does not perform variable renaming or dead code elimination.
- Not a full AST-based optimizer. For production builds use a bundler like Webpack or Rollup.
- May not produce valid output for all edge cases. Always test your minified code.
How It Works
Paste your JS code
Enter or paste any JavaScript code into the input area.
Click Minify
The Terser engine processes your code to remove comments and whitespace.
Copy the result
Get your minified code with compression stats and savings.
Frequently Asked Questions
Is this a full AST-based JavaScript minifier?
No. This is a basic whitespace and comment removal minifier. It removes comments and extra whitespace but does not perform variable renaming, dead code elimination, or other advanced optimizations.
Does it validate my JavaScript syntax?
Yes. The tool attempts to compile your code using new Function() after minification to check for syntax errors. If errors are found, they are displayed gracefully.
Is my JS code uploaded to a server?
No. All processing happens entirely in your browser. Your code never leaves your device.