JavaScript Minifier

Remove comments and unnecessary whitespace from JavaScript, safely.

Your JavaScript

Size: —
Comments are removed and whitespace is collapsed, but identifiers are not renamed.

How to use the JavaScript Minifier

  1. Paste the JavaScript you want to shrink.
  2. Click Minify to remove comments and collapse whitespace.
  3. Copy the result, then test it before deploying.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online javascript minifier.

It removes comments and collapses unnecessary whitespace, then reports how much smaller the file became.
No. Identifiers are left untouched, so the output stays readable and safe. Use a build tool if you need aggressive mangling.
The minifier tracks strings, template literals and regular expressions so their contents are never modified. Always test the output before deploying.
Because it does not rename or shorten identifiers, it removes less than tools like Terser, but the result is far easier to trust.
Yes, it preserves whatever syntax you paste. It simply avoids touching anything inside strings, templates or regular expressions.
No. Everything runs locally in your browser, so your data never leaves your device.
Yes. The tool is fully responsive and works in any modern browser on desktop, tablet and phone.
Yes, it is completely free with no account required.

Last updated: October 10, 2026