JS Minifier

Smaller JavaScript, carefully — strings, templates and regexes left exactly as written.

100% FREE & Unlimited Use — No Sign-Up, No Spinning Wheels — Your Files Never Leave Your Device

Honest limits: this is a careful whitespace-and-comments minifier, not a compiler. It never renames variables or rewrites code, and it keeps line breaks wherever automatic semicolon insertion could change meaning. For production bundles with tree-shaking, use a full build tool — for a quick, safe shrink of a script, this is the right size of hammer.

How it works

The minifier first tokenizes your code properly — strings, template literals, regular expressions and comments are identified before anything is removed, so a “//” inside a string or a division sign that looks like a regex can never be mangled. Comments and dead whitespace go; a space survives wherever removing it would merge two tokens (think a + +b or two words becoming one), and a line break survives wherever JavaScript's automatic semicolon rules could bite. Beautify (lite) re-indents by brace depth for quick reading.

Frequently asked questions

How much smaller will my file get?
Comment-heavy hand-written code typically shrinks 25–45%. Code that is already tight shrinks less — the status line tells you the truth either way.

Why not rename variables like big minifiers do?
Because that is a compiler's job, and getting it wrong breaks sites silently. This tool does the safe 80%: comments and whitespace. Your code means exactly the same thing afterwards.

Should I test the output?
Yes — drop it into a staging page first, as you would with any minifier's output. The tool is careful; testing is still cheap insurance.

Your privacy

This tool runs entirely in your browser, on your own device. Nothing you type, paste or open here is uploaded to a server, saved, or shared — close the tab and it is gone. That is the standing rule for every tool on Just SEO Tools.