JavaScript Minifier

Remove unnecessary comments and whitespace from your JavaScript to reduce its size. It does not rename variables, so the result is safe and easy to debug.

Conservative minification: only unnecessary comments and whitespace are removed; variables are not renamed and the code is not rewritten.

Original
—
Minified
—
Saved
—

Frequently asked questions

Does it rename my variables?

No. It only removes unnecessary comments and whitespace, so the code stays easy to debug. For bigger reductions, use a bundler such as esbuild or terser in your build process.

Does it keep the line breaks that matter?

Yes. Line breaks are kept wherever automatic semicolon insertion could change the meaning of the code.

What about regular expressions and templates?

They are copied as they are, just like quoted strings and backtick templates.

Related tools