Free Online JavaScript Minifier
The JavaScript Minifier strips comments and unnecessary whitespace from your JS to reduce file size. It is a dependency-free, string- and regex-aware minifier suitable for everyday code.
How to Use
Paste your JavaScript and click Minify. The compact version appears on the right.
- Removes // and /* */ comments
- Preserves strings and regular expressions
- Keeps a space between adjacent identifiers to avoid token merging
A Note on Scope
This is a lightweight, browser-based minifier. For production builds with full optimization (dead-code elimination, mangling), use a dedicated bundler like esbuild or Terser.