JavaScript Minifier

Minify plain JavaScript by removing whitespace and comments only. Variable names are preserved and compress optimizations are disabled. TypeScript and JSX are not supported.

  • Runs entirely in your browser
  • No data stored or sent to a server
  • Free forever — no signup
  • Instant conversion

Input and Output

Use the interactive encoder and decoder on this page to process your text.

Learn more about JavaScript

How to Minify JavaScript

JavaScript Minification

When to Minify JavaScript

Compress scripts for production bundles, compare minified output sizes, or inspect how whitespace removal affects code length before deploying static assets or embeddable widgets.

What Minify Does

Removes comments and unnecessary whitespace. Variable names are not mangled and compress optimizations are disabled, so output stays closer to the source than production minifiers.

Common Mistakes

  • Expecting minify to fix syntax errors — invalid code will fail
  • Running untrusted minified output without reviewing it first
  • Assuming minified size equals gzip size — always measure compressed bytes

Frequently asked questions

Is minified output safe to run?

Minified code is still executable JavaScript. Only run output you trust, same as any source code.

Why are variable names preserved?

Preserving names keeps minified output easier to debug than production builds that mangle identifiers.