Home/Developer/JavaScript Minifier

JavaScript Minifier

Shrink JavaScript by stripping comments and collapsing unnecessary whitespace so the code takes fewer bytes. This is a lightweight structural minifier meant for quickly compacting small scripts, snippets and inline handlers rather than a full compiler like Terser, so it will not rename variables or perform deep optimizations, which keeps its behavior predictable and safe. It carefully preserves the contents of strings, template literals and regular expressions while removing single line and block comments and squeezing runs of spaces and newlines. It reports how many bytes you saved. Paste your JavaScript, click minify, and copy the smaller result. Everything runs locally in your browser, so proprietary or third party code you are compacting is never sent to any server.