Back to tools
Free tool

JavaScript Minifier

Paste JavaScript to strip comments and extra whitespace. Runs entirely in your browser — nothing is uploaded anywhere.

Safe by design: this strips comments and leading/trailing whitespace but deliberately keeps line breaks intact. Collapsing every line onto one is how naive JS minifiers silently break code via automatic semicolon insertion (a bare return followed by a newline means something different once that newline is gone). For maximum compression in production, use a real bundler with Terser or similar as part of your build — this tool is for a quick, safe shrink, not a production pipeline.

Need a proper build pipeline instead?

We set up bundling, minification and CI/CD that won't silently break your code.

See DevOps services