JS Minifier
▸About this tool
Strip comments and collapse whitespace from JavaScript to reduce file size. Basic minification: no variable renaming. Runs entirely in your browser.
▸Privacy and details
Fast browser processing with no account required.
Optimized for desktop and mobile with accessible controls.
▸How to use
- Paste your JavaScript into the input area.
- The minified output appears instantly with the bytes saved shown above.
- Click "Copy JS" to copy the result to your clipboard.
- Or click "Download .js" to save the minified file.
▸Why use this tool
Reducing JavaScript file size improves page load performance. This tool performs safe comment and whitespace removal: no variable renaming or dead code elimination: making it safe to use without a build pipeline.
Frequently Asked Questions
What does the JS Minifier do? + -
It removes single-line comments (//) and multi-line comments (/* */), then collapses consecutive whitespace. The result is a smaller file with the same runtime behaviour for most code.
Is this a full minifier like Terser or UglifyJS? + -
No. This is a lightweight basic minifier. It does not rename variables, remove dead code, or perform tree-shaking. Use it for quick size reduction without a build step.
Can it break my JavaScript? + -
In rare cases: regular expressions containing // may be affected, and strings with /* or */ patterns are handled conservatively. Always test the output before using in production.
Does it handle ES6+ syntax? + -
Yes: the minifier works on any valid JavaScript text. It does not parse the AST, so modern syntax like arrow functions, template literals, and optional chaining are preserved unchanged.
Is my code sent to a server? + -
No. Minification runs entirely in your browser. Your code is not sent to a NixRey server.