JavaScript Minifier & Beautifier

Minify or beautify JavaScript. Shorten variable names, remove whitespace, and show compression savings.

Free Always No Account Needed 100% Client-Side

About this tool

JavaScript is often the largest contributor to page weight. Minification significantly reduces download and parse time.

JS Minifier compresses JavaScript by: - Removing whitespace, comments, and newlines - Shortening variable and function names (mangling) - Simplifying boolean expressions (!!0 → false) - Removing dead code branches

JS Beautifier reformats minified or compressed JavaScript with proper indentation, consistent spacing, and newlines — turning production code back into readable source (note: mangled variable names cannot be recovered without a source map).

This tool uses a pure JavaScript implementation for client-side processing. No code is ever sent to a server.

Frequently Asked Questions

What is the difference between minification and obfuscation?
Minification removes whitespace/comments for size. Obfuscation deliberately makes code hard to read (renamed variables, encoded strings). This tool only minifies.
Can I un-minify (beautify) production code?
You can re-add whitespace and indentation, but if variable names were mangled you can't recover the original names without a source map.
Does minification break my code?
Standard whitespace and comment removal is always safe. Name mangling can occasionally break code that uses eval() or dynamic property access.
Should I minify ES modules?
Yes, but use a bundler like Vite or esbuild for production — they handle imports, tree-shaking, and minification together.

Related Tools