Quick Answer
A JavaScript minifier removes comments, blank lines and unnecessary whitespace from your code, shrinking the file the browser has to download. This tool is deliberately conservative: strings, template literals and comments inside them are preserved exactly, so behavior never changes.
What This Tool Does
The minifier tokenizes your code so it never edits inside strings, template literals or comments. Comments are removed, whitespace runs collapse safely, and — with the Mangle variable names option — locally declared variables and function parameters are renamed to short names like a or b, the same trick Terser-style tools use. The result is smaller without changing what the code does.
Key Features
- String-safe — quotes, template literals and escape sequences are untouched.
- Comment removal —
// lineand/* block */comments are stripped. - Variable mangling — shorten local variable names and parameters (scope-aware, skips properties, object keys, templates and globals).
- Independent options — toggle comment removal, whitespace collapsing and mangling separately.
- Live savings + gzip estimate — input/output size, percentage saved, and an approximate gzipped size.
- Upload file or load from URL — minify existing scripts directly.
- Copy or download the minified file.
How to Use the JavaScript Minifier
- Paste your JavaScript into the input box, or use Upload File / Load from URL.
- Open Show advanced options and tick Mangle variable names for maximum savings (on by default).
- Read the minified output and the size stats, including the gzip estimate.
- Click Copy or Download to take the result.
Use Cases
- Quickly shrinking a script before pasting it into a single-file page.
- Preparing an inline snippet where size matters.
- Seeing how much overhead comments and formatting add to a file.
Tips
- This is lightweight minification. For production, a real bundler also does dead-code elimination, which saves far more.
- Keep the readable source in version control; minify at build time.
- Test the minified output once before shipping — a quick smoke test catches surprises.
Privacy
Your code never leaves your browser. Safe even for proprietary scripts.
Conclusion
Smaller JavaScript means faster pages. Minify here, instantly and privately, then wire it into your real build pipeline.