Advertisement

JavaScript Minifier

Quickly and easily minify JS code and optimize performance. Paste your JavaScript Code below.

Advertisement

JavaScript Minification

JS minification removes whitespace, comments, and optional syntax, and optionally mangles variable names to produce the smallest possible script that behaves identically to the original.

What Minification Does

Typical Size Reduction

What's the difference between minification and uglification?

Minification removes whitespace and comments. Uglification (obfuscation) additionally renames variables to short meaningless names. Tools like Terser and UglifyJS do both. Obfuscation makes code harder to reverse-engineer but not impossible — it's not a security measure.

How do I debug minified JavaScript?

Use source maps — minifiers can output a .map file that maps minified positions back to original source lines. Modern bundlers (Webpack, Vite, esbuild) generate source maps automatically, and browser DevTools use them to show the original code when debugging.

Should I minify third-party libraries?

Most popular libraries (React, Lodash, etc.) already ship pre-minified production builds. Minifying them again provides no benefit. Focus minification on your own application code, or use a bundler like esbuild or Rollup that handles everything in one pass.