ToolsDoc

JavaScript Minifier

Strip comments and extra whitespace from JavaScript code.

Removes comments and whitespace only — not a full AST-based minifier like Terser.

Worth Knowing

Minifying JavaScript strips comments and whitespace to shrink the file browsers must download, which directly improves page-load speed — every kilobyte counts on mobile connections. This tool does the safe, lightweight version; production build tools go further, renaming variables to single letters and eliminating dead code. The one rule minification must never break is behavior: the code has to run identically, which is why automatic semicolon insertion makes naive whitespace removal risky in JavaScript specifically.

How to Use

  1. Paste or type your javascript into the JavaScript Minifier above.
  2. The output updates instantly and is ready to copy.
  3. Removes comments and whitespace only — not a full AST-based minifier like Terser.

Frequently Asked Questions