Dev
JS Minifier
Input
Output
Run process to generate output.
Frequently Asked Questions
What does JavaScript minification do?
It reduces file size by: removing whitespace and comments, shortening variable names (mangling), combining statements, and removing dead code. Variable mangling is the most significant size reduction: 'longVariableName' becomes 'a'.
Does minification change how the code behaves?
Properly done, no. Comments are non-functional; whitespace is syntactically insignificant (mostly). Variable renaming is safe within properly scoped code. However, code that relies on Function.name, variable name reflection, or eval() may break after mangling.
Should I minify in development?
No. Development should use the original readable source for debugging. Minification is a production build step. Use source maps (*.map files) alongside minified files to enable browser DevTools to show original source during debugging even in production.