Highly configurable JavaScript compressor for smaller file sizes
JavaScript minification is the process of removing all unnecessary characters from JavaScript source code without changing its functionality. This includes:
The primary goal is to reduce the file size, which leads to faster page load times and reduced bandwidth usage.
Minifying your JavaScript offers several advantages:
Tip: For production, combine minification with GZIP compression for maximum file size reduction.
Warning: Be cautious with "unsafe" options as they might change code behavior in edge cases. Always test minified output.
Q: Is my code sent to your servers?
A: No! All processing happens locally in your browser using Terser. Your code never leaves your device.
Q: Will minification break my JavaScript?
A: Generally, no. Standard minification should not break your code. However, if you enable certain "unsafe" options, or if your original code has errors, issues might arise. Always test the minified output.
Q: Can I reverse minified JavaScript?
A: Minification is a destructive process in terms of readability. While the functionality remains, restoring the original formatting (indentation, comments, variable names) is not possible. For development, keep a well-formatted version of your source code.
Q: What's the difference between minification and obfuscation?
A: Minification focuses on reducing file size while maintaining functionality. Obfuscation makes code harder to understand while also reducing size. This tool focuses on minification with some obfuscation through name mangling.