Regex vs division
Minifiers must tell /foo/ (a RegExp) from a/b (division). Heuristics look at the token before the slash to decide.
This JavaScript Minifier & Beautifier runs entirely in your browser—no uploads, no tracking, and no external APIs.
The minifier uses a conservative tokenizer to safely remove comments and extra whitespace while preserving strings,
regular-expression literals, and template literals (including nested ${...}). The beautifier applies
indentation based on braces and statement boundaries for a readable result.
// and /* ... */ comments./*! ... */ banner comments (common for licenses).) and [, or after return before a regex literal).Keyboard shortcut: Ctrl/Cmd + Enter runs Minify. Your last input persists locally so you can pick up where you left off.
No. This tool runs entirely in your browser. Nothing is sent to any server.
It’s intentionally conservative for safety and privacy. It removes comments/whitespace and preserves behavior, but does not perform advanced AST transforms or mangling.
Yes — enable “Keep /*! ... */ license banners” to preserve license comments.
Minifiers must tell /foo/ (a RegExp) from a/b (division). Heuristics look at the token before the slash to decide.
Automatic Semicolon Insertion works, but edge cases (return then newline then /regex/) can bite. Safe minifiers add semicolons in risky spots.
Comments starting with /*! … */ are often licenses. Minifiers keep them when you enable the option, dropping the rest for size.
Less whitespace means smaller bundles before gzip/brotli, which makes compression ratios even better.
Pretty-printing can expose dangling braces or mismatched indentation that hide in minified blobs—great before code reviews.