moim.bio

JavaScript Minify

More than stripping whitespace — it shortens variable names and drops dead code. Terser, running in your browser.

It does more than delete whitespace

This tool runs Terser inside your browser — the very minifier your bundler (webpack, Vite, Rollup) uses for a production build. It parses the code into a syntax tree and writes it back out.

StageWhat it does
Strip whitespace and commentsThe basics. Usually 20–30% off
Shorten variable namesLocal userName becomes a. This is where the big win is
Drop dead codeUnused variables, if (false) blocks and unreachable code go away

Watch out: shortening names

Only local variables change. Globals and object properties are left alone, because something outside can reach them by name. Even so, these will break:

Always test the minified output before you ship it.

Stripping console

Use it to clear debug logging out of a production build. It removes console.error as well as console.log, so leave it off if you rely on the console for error tracking.

Syntax level

This is a minifier, not a transpiler. Choosing ES5 does not turn arrow functions into function. It only promises that minification will not itself produce code above that syntax level. If you need to support old browsers, run something like Babel separately.

Is my code sent to a server?

No. Terser itself (about 1 MB) is downloaded to your browser and executed here. After the page loads, no network is used, so pasting code from work does not put it anywhere. The trade-off is that this page is a little heavier to open than the others.

Can minification be undone?

JavaScript Formatter restores the indentation. The shortened variable names and deleted comments do not come back.

Is this an obfuscator?

No. The output being hard to read is a side effect; the goal is size. If hiding the code is the point, dedicated obfuscators exist — though nothing fully hides code that has been shipped to a client.

23 more tools