JavaScript Minifier

Make a script as small as it goes.

Minified

About this converter

Runs terser, which is the minifier most build tools use, so the result matches what your pipeline would produce.

Two settings, and they do different jobs. Mangling renames local variables to single letters — safe, and usually the larger saving. Compressing rewrites the code: dead branches removed, expressions simplified, short forms substituted. That is where the risk lives, and it is small but real if your code depends on function names or on properties reached by string.

Whether it is parsed as a module or a script is worked out from the code — a file using import or export is a module, and parsing it as a script would fail on the first line.

Frequently asked questions

Is minified code the same as obfuscated code?

No. Minifying makes a file smaller and leaves it perfectly readable once formatted — the beautifier on this site will do that. Obfuscation deliberately makes code hard to follow. Minified code is not protected code, and anything sent to a browser can be read by whoever receives it.

Could this break my script?

Rarely, and the causes are specific. Code that reads Function.name, relies on a stack trace, or reaches properties through strings the minifier cannot see can all be affected by mangling. Turn compression off first if something breaks — it is the more aggressive of the two.

Should I minify by hand at all?

For a file going into a build, no — your bundler already does it, and doing it twice gains nothing. This is for a standalone script, a snippet going into a template, or checking what a given file compresses to.

Does what I paste get sent anywhere?

No. Everything runs in your browser, on your own machine. Nothing is uploaded and nothing is logged. That matters more here than on most pages — source code, database queries and internal data are exactly the things that get pasted into tools like this, and most of them are a form that posts to a server.

Related tools