What this tool undoes
Many JavaScript obfuscators — including the browser-based one on this site — rewrite code through a small set of mechanical, purely static transforms: they move every string literal into one array and replace each use with a call to a getter function, they escape ordinary characters as \xNN or \uNNNN sequences, they expand simple arithmetic into equivalent-but-longer expressions, they wrap real code in an always-true or always-false if, and they rewrite a.b as a['b']. This tool reverses exactly those five things:
- String-array inlining — finds
var _s = ["foo", "bar"]; function _g(i){ return _s[i]; }and replaces every_g(0)-style call whose index is a literal number with the actual string, then removes the array and function if nothing else uses them. - Escape decoding — shows
\x48\x69asHiinstead of the escaped form. - Constant folding — turns
1 + 2into3,"a" + "b"into"ab", and similar literal arithmetic, skipping anything that would require guessing (like division by a literal zero). - Dead-branch removal —
if (true) { A } else { B }becomes justA; awhile (false) {}disappears entirely. - Bracket-to-dot —
obj['name']becomesobj.namewhennameis a valid identifier.
What it will not do
This is static pattern-matching over an AST, not a general deobfuscator. It does not execute any code, so it cannot unpack an eval-based loader, solve an opaque predicate that depends on a runtime value, or reverse control-flow flattening beyond the single always-literal if/while/ternary case above. Variable names are left exactly as they are — _0x1a2b stays _0x1a2b. If your file doesn't match the string-array + getter-function shape exactly, that stage simply reports zero inlined calls rather than guessing at a different pattern.
How it works
The code is parsed into an AST with acorn, walked and rewritten with hand-written transforms that only ever act when a value is already provably a literal, and regenerated with astring. Nothing is uploaded — parsing and rewriting both happen in your browser.
Using it
Paste or type JavaScript into the editor and run it. The summary shows exactly how many times each stage fired, so you can see what changed and what didn't. Copy the result or download it as a .js file.
Tiny Online Tools







