JS Minifier

Remove comments and collapse whitespace from JavaScript to reduce file size for production use. String and template literal contents are preserved exactly. A useful quick step for standalone scripts — for complex, bundled applications, a proper build tool like esbuild or Terser will give better results and handle source maps.

All processing happens in your browser. No data is sent to any server.

Frequently Asked Questions

What does the JS minifier do?
It removes single-line (//) and block (/* … */) comments and collapses excess whitespace. String and template literal contents are preserved unchanged.
Does it mangle variable names?
No — this is a basic whitespace-and-comment minifier. For variable mangling, dead-code elimination, and tree-shaking, use a production build tool like Terser or esbuild.
Is the output safe to use in production?
For simple, single-file scripts it is. For complex, bundled applications use a proper build tool that handles module resolution, source maps, and advanced optimisation.

Related Tools