JavaScript Minifier
Trim comments and needless whitespace from JavaScript for a quick, safe size reduction.
JavaScript Minifier
This is a conservative, whitespace-and-comment minifier — it does not rename variables. For maximum compression use a build tool like Terser.
🔒 Nothing you enter is sent anywhere or stored. All processing happens in your browser.
How it works
Shipping less JavaScript means faster pages. This minifier gives you a quick, safe reduction by removing what the engine doesn't need to run your code: single-line and block comments, and redundant whitespace and blank lines. It's careful to leave the contents of strings and template literals untouched, so your code keeps working.
Paste your script, minify, and see the original size, minified size, and percentage saved. Copy the compact version straight into a page or a quick experiment.
Deliberately conservative, it does not rename variables or restructure code — so there's far less risk of breakage than an aggressive optimiser. For production bundles where every byte counts, a full tool like Terser or esbuild in your build pipeline will compress further. Everything here runs locally; your code is never uploaded.