JavaScript Minifier
Compress JavaScript files for production — strip whitespace and comments, see the bytes saved, and copy the minified output instantly.
Free · No credit card · 50 credits/day
Minification techniques explained
Whitespace removal
Removes all spaces, tabs and newlines that are not inside strings. Safe, always done, biggest single saving.
Comment stripping
Removes // line comments and /* block comments */. Safe except for copyright banners (which can be preserved with /*! */).
Variable mangling
Renames long variable names to 1–2 character names. Can save 20–50% additional bytes beyond whitespace removal.
Dead code removal
Eliminates unreachable code paths — e.g. code after an unconditional return or inside if (false) {} blocks.
Constant folding
Pre-computes constant expressions at minification time (e.g. 60 * 60 * 24 → 86400) to reduce runtime work.
String deduplication
Replaces repeated string literals with a single variable to reduce total bytes in large bundles.
Frequently asked questions
Related dev tools
Minify the rest of your front-end stack.
Compress your JavaScript now
Free account. 50 credits per day. Access to 75+ tools instantly.
Create free account →