What this tool does
This obfuscator parses your code with acorn into a syntax tree, applies a few structural transforms, and regenerates JavaScript with astring — entirely in your browser. Nothing you paste is ever uploaded.
Be clear about what "obfuscation" means here: this is a deterrent against casual reading, not encryption and not real security. Anyone willing to run your code and inspect it (or just spend a bit more time reading it) can still recover its behavior. JavaScript that ships to a browser is always downloadable and always executable by the person receiving it — no transform can change that. Use this to make casual copy-paste and skimming harder, not to protect secrets. Never put real secrets (API keys, credentials) in client-side JavaScript, obfuscated or not.
The three levels
Basic renames every identifier the tool can prove is locally bound — function parameters, and var/let/const declarations inside a function — using a real lexical scope analysis, not a guess. Anything that resolves to a global or an external reference is left exactly as written, on purpose: renaming those would break your code. Whitespace and comments are also stripped as part of regenerating the source.
Medium does everything Basic does, plus it collects every string literal used as an expression into one array at the top of the file and replaces each occurrence with a call like _fn(3) that looks the string up by index.
Aggressive does everything Medium does, plus every string in that array is written with \x / \u escapes instead of plain characters, and straight-line runs of three or more statements are rewritten into a while(1) { switch(_i) { ... } } dispatcher loop, so the code's structure no longer reads top-to-bottom.
Correctness first
Every level is built to produce code that runs identically to what you pasted in. Where a construct can't be proven safe — destructuring patterns, eval, with — the tool skips renaming it rather than risk breaking your program. If your code contains eval or with, a notice tells you renaming was skipped entirely for that reason.
Reading the size numbers
The stat row shows the exact input and output byte counts and the percent change. Renaming and string extraction usually increase size a little (longer generated names, an extra array and accessor function) even though the code becomes harder to skim — obfuscation and minification are different goals.
Typical uses
- Making a small utility script less trivial to skim before sharing a demo or a CodePen.
- Learning how obfuscators work by comparing input and output side by side.
- Adding a light deterrent to a client-side script where the logic itself isn't sensitive.
Paste JavaScript, pick a level, and copy or download the result.
Tiny Online Tools







