Paste your JavaScript below. Remove comments and whitespace to reduce file size. See before/after stats. Nothing gets uploaded.
JavaScript minification reduces file size by removing code that isn't needed for execution: comments, extra whitespace, blank lines, and indentation. The result is functionally identical code that loads faster in browsers.
Any JavaScript you serve in production should be minified. Smaller files mean faster page loads, lower bandwidth costs, and better Core Web Vitals scores. Keep your original (unminified) source in version control and serve the minified version to users.
This tool performs safe, conservative minification: it removes comments (both single-line // and multi-line /* */), collapses multiple spaces and tabs into one, removes blank lines, and optionally trims trailing semicolons. It does NOT rename variables or perform dead-code elimination โ that would require a full parser like Terser or UglifyJS. For simple scripts, this tool will get you 30โ60% size reduction safely.