What does this JavaScript minifier remove?
It strips three categories of bytes: (1) line comments (// ...) and block comments (/* ... */); (2) all unnecessary whitespace — runs of spaces, tabs, newlines, and blank lines collapse to nothing or to a single space when needed to keep tokens apart; (3) optional whitespace around punctuation like braces, parentheses, commas, semicolons, and operators. String literals, template literals, and regex literals are preserved exactly as written.
Will minification break my regex or template literals?
No. The minifier uses a state machine that detects regex literals by looking at the previous token (regex appears after operators, return, typeof, etc.) and reads them whole — including character classes that contain forward slashes. Template literals (backticks) preserve their interior whitespace and ${...} expressions exactly. Single and double-quoted strings are also passed through untouched.
How much size reduction is typical?
Hand-authored JavaScript with full indentation and developer comments commonly compresses 30–55% with whitespace stripping alone. Already-clean output from a build tool may see 10–20%. Combined with gzip or brotli on the server, the wire-size savings stack — but every byte saved before compression also saves browser parse time on low-end devices.
Is this minifier as good as terser or esbuild?
No. Terser, esbuild, and SWC parse JavaScript into an AST and perform real optimisations: variable mangling, dead-code elimination, constant folding, function inlining, and property shortening. This tool is a heuristic state-machine minifier — it strips comments and whitespace safely for almost all practical code, but it cannot rename variables or perform structural optimisations. Use this for quick one-off minification; use terser/esbuild in your build pipeline.
Does it preserve "use strict" and license comments?
Both are configurable via toggles above the editor. By default both are preserved. License comments are detected by the /*! prefix or by @preserve / @license markers inside a block comment, matching the convention used by terser, uglifyjs, and Closure Compiler. The "use strict" directive is restored at the top of the output if it was present in the input.
Will it correctly handle ASI (automatic semicolon insertion)?
Mostly. Newlines that would have triggered ASI between two statements are converted to semicolons or preserved as separators. Code that relies on quirky ASI corner cases (e.g. a function call across lines that begins with an open parenthesis) can break — the same caveat that applies to terser. Author defensive code with explicit semicolons if you intend to minify.
Is my code uploaded to your servers?
No. The minifier runs entirely in JavaScript inside your browser. Source containing API keys, internal logic, or unreleased product code never leaves the device — verify in your browser DevTools Network tab. There are no requests, no telemetry, and no rate limits.
Can I un-minify the output back to readable JavaScript?
Yes. Paste the minified result into our JavaScript Pretty Print or jsbeautifier tool and it will reformat the code with proper indentation. The two operations are exact inverses for whitespace, although comments removed during minification cannot be recovered.