JavaScript Minifier
Quickly and easily minify JS code and optimize performance. Paste your JavaScript Code below.
Quickly and easily minify JS code and optimize performance. Paste your JavaScript Code below.
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.
// and block /* */longVariableName → a1 + 2 → 3 at compile timeMinification 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.
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.
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.