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.
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. Copy, download, or flip back to beautify if you need to read it.
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.