Note: this removes comments and collapses whitespace only. For production builds, use a proper minifier like Terser or esbuild, which also rename variables and optimize code.
Frequently asked questions
What does this minifier actually do?
It safely removes single-line and block comments and collapses unnecessary whitespace, while leaving strings and template literals untouched. It never renames variables or changes logic.
Is the output safe to use?
Yes for the transform it performs, but always test. The built-in syntax check flags obvious errors, and for production builds use Terser or esbuild for real optimization.
What is the gzip estimate?
Browsers usually receive JS gzip-compressed. The estimate shows the real compressed size of your minified code, measured in your browser, so you see the true download saving.
Preview
Related free tools
Free Base64 Encoder Decoder
Free Base64 encoder and decoder. Encode text to Base64 or decode Base64 back to text, righ
Free CSS Minifier Online
Free CSS minifier. Remove comments and whitespace from CSS to shrink file size and speed u
Free SHA-256 Hash Generator
Free SHA-256 hash generator. Hash text with SHA-256, SHA-384 or SHA-512 securely in your b