Shrink your JavaScript — privately
A JavaScript Minifier shrinks a script by removing comments and insignificant whitespace, producing smaller code that behaves identically. This one runs entirely in your browser — unlike many minifiers that send your code to a server, nothing is uploaded here — and it shows how many bytes you save.
Three levels, and the difference between them is what the compressor is allowed to do. Basic takes out whitespace and (unless you keep them) comments, and touches nothing else. Standard is the default and adds Terser's safe compressions — constant folding, unreachable branches, shorter equivalent syntax. Aggressive also renames local variables and runs the compressor twice. Alongside them: Keep licences preserves comments written /*! or carrying @license, Drop console removes console.* calls and debugger statements, and Source map produces a .map file to download beside the script.
Smaller scripts load and parse faster. A JavaScript minifier reduces file size by removing comments and collapsing insignificant whitespace — the indentation, line breaks, and spacing that make code readable but that the engine doesn't need. The result is a compact, behaviorally identical script.
Paste your JavaScript or load a local file, and the tool minifies it and shows the size before and after with the percentage saved. It preserves the semantics of your code — strings, template literals, and regex are untouched — so the minified output runs exactly like the original. The output pane has a Readable view for when you need to check what came out, and Copy and Download take whichever of the two you are looking at.
The privacy angle is especially meaningful here. Several popular JavaScript minifiers POST your code to their server to process it — which is a real concern for proprietary or sensitive logic. This tool does everything in your browser: no server, no upload, no logging, no tracking. Your code never leaves your device, and the tool works offline once loaded.
Honest, important caveats. Minifying is behavior-preserving, but always keep your original source — minified JS is hard to read and debug, and comments are gone for good. For complex code, test the minified output before shipping. This is a minifier, not a bundler or transpiler: it won't resolve imports, tree-shake unused code, or convert TypeScript/JSX — for a full build, use tools like Terser, esbuild, or Rollup. Note "minify" (whitespace/comments) differs from aggressive "uglify/mangle" (renaming variables), which saves more but is riskier. And for transport, gzip/brotli usually saves more than minifying alone, though they stack.
For the reverse, see the JavaScript Formatter; for markup and styles, the HTML Minifier and CSS Minifier.