JSFuck Decoder
Paste a JSFuck expression and see the string or the code it really produces, worked out in a sealed-off sandbox.
Input
Decoded Output
What Is the JSFuck Decoder?
Ever opened a JavaScript file and found nothing but +!+[]+(![]+[])[+[]] stretching across the screen? That's JSFuck, a way of writing any JavaScript with six characters: [, ], (, ), ! and +. It only makes sense once the coercions are carried out: ![] is false, ![]+[] is the string "false", and (![]+[])[+[]] picks its first letter, f. MDN JavaScript documents the type conversions involved, and the ECMAScript specification defines exactly why +!+[] evaluates to 1. Once you have the decoded code, AST Explorer shows its parse tree, Chrome DevTools lets you step through it, and Babel can normalise it further. Your input is never uploaded.
Because the meaning only appears when the expression is evaluated, that is what this page does, inside a sealed-off sandbox frame that cannot see this page, your cookies or your storage, and that is stopped after two seconds. Most JSFuck payloads end in a Function(...)() call, which turns a string into code and runs it. When that call is the last step, the page shows you the code it would run and does not run it. Building that string can mean evaluating smaller pieces of the expression first, and that only happens inside the sandbox. To go the other way and hide code, use JavaScript Obfuscator. For formatting only, use JavaScript Formatter. For validation, use JavaScript Validator.
How to Decode JSFuck
Paste or Upload
Paste the JSFuck into the left pane or Upload a .js or .txt file. Only [ ] ( ) ! + and whitespace are accepted, up to 256 KB; any other character is pointed out by line and column. Sample loads a real JSFuck wrapper around console.log(1).
View Decoded Output
Pause typing for a beat and the decoded result fills the right pane. A plain expression gives its value as text, so a JSFuck string comes out as that string. A Function(...)() wrapper gives the code it would run, indented, under a comment saying it was not run. Broken input, such as an unclosed bracket or two plus signs with no space between them, gets a short explanation instead.
Copy or Download
Save the result with Copy or Download. To actually run a decoded snippet, and only once you trust it, use the JavaScript Console.
JSFuck Decoder Example
The four letters below come from "undefined", "false" and "true": each bracket pair turns a boolean or undefined into a string, and the number after it picks one character.
Example: a JSFuck string
JSFuck input:
Decoded output:
When the JSFuck Decoder Helps
Malware triage is the usual reason: a script injected into a compromised page arrives as a wall of brackets, and you need to know what it would have done before deciding how bad the incident is. It also comes up in CTF challenges, and when a web filter flags a file full of []()!+ and you want to know whether it is a payload or a joke.
Frequently Asked Questions
Is my data private when using this tool?
Yes. Nothing is uploaded: the expression is evaluated in a sandbox frame inside your own browser tab, which matters when the sample is malware or belongs to a client.
Does this decode every JSFuck payload?
Anything that is valid JavaScript made only of the six characters, including the output of the common JSFuck encoders. The input has to be a single expression, as JSFuck always is, and it has to finish within two seconds. Input that mixes JSFuck with ordinary code is refused; for that, try the general deobfuscator.
What is JSFuck and why is it used?
JSFuck is a JavaScript encoding technique that uses only 6 characters: `[`, `]`, `(`, `)`, `!`, and `+`. It's used in CTF challenges, malware obfuscation, and as a JavaScript curiosity. The output is still valid JavaScript.
JSFuck Decoder or the general JavaScript Deobfuscator: which one do I need?
This page works out what a six-character expression evaluates to, so its answer is exact. The general deobfuscator works on ordinary JavaScript and undoes common tricks such as escaped strings and packed code, without running anything.
Is it legal to decode or deobfuscate JavaScript?
For your own code, security research or CTF challenges, yes. For third-party code, always check the license and terms of service first.