JavaScript Minifier

Strip comments and whitespace from JavaScript.

Lightweight minifier — strips comments and collapses whitespace. It does not rename variables or do full AST optimization; for production builds use a bundler like esbuild or Terser.

Input JavaScript
Minified

Free online JavaScript minifier. A lightweight minifier that strips comments and collapses whitespace to shrink your JavaScript, showing the bytes saved. Runs in your browser.

How to use the JavaScript Minifier

  1. 01Paste your JavaScript.
  2. 02See the minified output plus the size saved.
  3. 03Copy the compressed code.

Frequently asked questions

Is this a full minifier like Terser?

No — it's a lightweight minifier that removes comments and whitespace while preserving strings. It doesn't rename variables or do dead-code elimination. For production builds, use a bundler like esbuild or Terser.