DEVELOPER TOOL

JavaScript Minifier & Compressor

Shrink JavaScript for production using Terser, entirely in your browser.

About this tool

Paste JavaScript code to shrink it for production — removing whitespace and comments, folding constants, eliminating dead code, and optionally shortening variable names. This uses Terser, the same minifier used by many production build tools, running entirely in your browser.

Nothing is uploaded — your source code is minified locally and never leaves your device.

Frequently asked questions

Is this safe to use on production code?
Terser is a mature, widely used minifier (the successor to UglifyJS) that powers minification in many popular build tools, so it's well-tested on real-world code. Still, always test minified output before deploying it, as with any build step.
What does "shorten variable names" do?
It renames local variables and function parameters to short, meaningless names (like single letters) to save space. Turn it off if you need to keep the output more readable, for example while debugging.
What happens if my code has a syntax error?
Minification fails and a hint shows what's wrong, similar to how a build tool would report it — fix the syntax error in the source and try again.