JavaScript Minifier & Formatter
Minify JavaScript for production — removes whitespace, comments and shortens variable names. Or beautify minified code back to readable form. Runs entirely in your browser, nothing is sent to a server.
Minify JavaScript for production — removes whitespace, comments and shortens variable names. Or beautify minified code back to readable form. Runs entirely in your browser, nothing is sent to a server.
JavaScript minification removes everything the browser doesn't need: whitespace, newlines, comments, and optional semicolons. The resulting file is semantically identical but significantly smaller, leading to faster downloads and faster parse times — especially on mobile.
Strips both // single-line and /* block */ comments, including JSDoc annotations.
Optionally strip all console.log(), console.warn() and console.error() calls from production builds.
Beautify minified or compressed code back to readable, consistently indented form with your chosen indent size.
See the original vs. compressed size and percentage saved with every processing run.
A typical JavaScript file saves 20–40% through minification alone. Combined with gzip or Brotli compression on the server, total transfer savings often reach 70–85%. For a 200 KB bundle, that can mean only 40 KB sent over the wire — a significant improvement for mobile users on slower connections.
This tool is ideal for quick one-off minification of utility scripts, third-party code you don't control, or small standalone files. For production applications and bundled projects, a proper build pipeline using esbuild, Rollup, or webpack with Terser is recommended — they handle ES module tree-shaking and advanced optimisations this tool doesn't attempt.
Basic whitespace and comment removal is always safe. This tool does not rename variables or mangle identifiers, which are the operations that can occasionally break code relying on Function.name or dynamic property access. The output is semantically identical to the input.
Yes — the minifier works on any valid JavaScript text regardless of version. It removes comments and collapses whitespace without parsing the AST, so optional chaining (?.), nullish coalescing (??), and other modern syntax is handled safely.
No. All processing happens entirely in your browser using JavaScript. Your code never leaves your machine and nothing is logged or stored.
Minification removes whitespace and comments to reduce file size — the code is still readable if reformatted. Obfuscation intentionally renames variables and restructures logic to make reverse engineering harder. This tool only minifies, not obfuscates.