Developer Tools
JavaScript Whitespace Minifier
Strip comments and whitespace from JS — honestly named, string-safe.
Powering up the tool…
What this tool does
About the javascript whitespace minifier
Not a compiler: no renaming, no tree-shaking, no risk.
How to use it
- Paste the JS.
- Read the stripped result and savings.
- Test it — you always test it.
- For production bundles, use a real minifier (terser et al.).
Useful for
- Shrink a snippet for an inline tag.
- Strip comments before sharing.
- Squeeze a bookmarklet under length limits.
Straight answers
JavaScript Whitespace Minifier FAQ
Why “whitespace minifier” and not just minifier?
Truth in labelling: real minifiers parse and rewrite (rename variables, drop dead code) and need a full JS engine grammar. This tool removes comments/whitespace with string-aware care — meaning-preserving by construction, modest by design.
Can it break anything?
The known edge: automatic-semicolon-insertion code that RELIED on line breaks. Well-formed code with semicolons survives untouched; cursed code was already cursed.