JavaScript Minifier

Strip comments and blank lines from JavaScript safely.

Runs in your browser Developer Tools Free · No account

Input

Processed locally

This tool runs entirely in your browser. The data you paste or load is never uploaded.

Result

Enter your input, then run the tool.

About this tool

Conservative minifier that removes comments and redundant whitespace while leaving strings, template literals, regular expressions and automatic semicolon insertion untouched. It reports the size saved and never renames variables.

How to use it

  1. Paste a JavaScript file.
  2. Decide whether comments should be stripped.
  3. Minify, then test the output before deploying it.

Frequently asked questions

Will this break my code?
It is deliberately conservative, but any whitespace-sensitive code can be affected. Always run your tests against the minified file; for production builds a compiler such as esbuild is still the better choice.
Does it mangle variable names?
No. Renaming requires full scope analysis, which a text-based tool cannot do reliably.

Keep going

More in this category