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.
It is a lightweight minifier that removes comments and collapses whitespace while preserving string contents, giving a smaller file for quick inline use.
No. It focuses on stripping comments and whitespace rather than aggressive renaming, so it is safe for quick shrinking but not a full compiler.
Yes. It shows how many bytes you saved compared to the original.
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.
Yes. JavaScript Minifier is completely free, with no sign-up and no usage limits.
Yes. JavaScript Minifier runs in any modern web browser. There is nothing to download or install.
Yes. JavaScript Minifier runs entirely on your device in your browser, so nothing you enter is uploaded to a server.
Link this tool from a README, doc or site. The badge links back to this page.
[](https://yourhack.ai/js-minifier)