Practical Guide

JSFuck Encoder — Usage Guide and Technical Principles

JSFuck uses only []()!+ and JavaScript type coercion to construct expressions. This tool encodes input as a string expression without running it.

Open tool

Overview

JSFuck uses only []()!+ and JavaScript type coercion to construct expressions. This tool encodes input as a string expression without running it.

Key concepts

JSFuck Esoteric Encoding and JavaScript Type Coercion

JSFuck is an esoteric JavaScript encoding style using only 6 characters: [ ] ( ) ! + to write any JavaScript code. This exploits JavaScript's type coercion and implicit conversions: empty array [] coerces to empty string "", + operator concatenates strings, ! negates to boolean, and () executes functions. The encoding builds primitives: false (![]), true (!![] true from double negation), undefined ([][[]] accessing non-existent array index),

Character Construction and Encoding Algorithm

The encoding algorithm maps each character to JSFuck representation through layered construction: basic characters extracted from primitive strings (f,a,l,s,e from "false", t,r,u from "true", i,n,d from "undefined", N from "NaN"), numbers constructed through arithmetic (+!![] → 1, +![] → 0, combinations like 10 as +!![]+[+[]]), and advanced characters from constructor strings ([].constructor → "function Array() { [native code] }" providing c,o,n,

Educational Purpose and Code Obfuscation Concepts

JSFuck serves primarily educational purposes: demonstrating JavaScript's type system flexibility, illustrating implicit type coercion mechanisms, understanding truthy/falsy values and operator precedence, and exploring language features often considered confusing. The tool educates on code obfuscation concepts: making code unreadable while preserving functionality, understanding how deobfuscation works (reverse engineering encoded logic), and

Features

JSFuck Encoder

JSFuck uses only []()!+ and JavaScript type coercion to construct expressions. This tool encodes input as a string expression without running it.

Encode to JSFuck

Enter up to 100 characters and encode them as a six-character JSFuck expression. The output represents a string and is not executed.

Use Cases

JSFuck Encoder

Enter up to 100 characters and encode them as a six-character JSFuck expression. The output represents a string and is not executed.

Frequently asked questions

What is JSFuck and how does it work?

JSFuck is an esoteric programming style that uses only six characters: [, ], (, ), !, and + to write JavaScript code. It's based on JavaScript's type coercion and operator overloading. JSFuck works by using these characters to construct any JavaScript value or expression. For example, false is represented as ![], true as !![], and numbers are constructed using arithmetic operations.

Why would someone use JSFuck encoding?

JSFuck is primarily used for: code obfuscation and minification challenges, educational purposes to understand JavaScript's type system, security research and testing, bypassing certain filters that block specific characters, and as a programming puzzle or challenge. It's not typically used in production code due to its extreme verbosity and performance overhead.

How does JSFuck encode JavaScript code?

JSFuck encoding works by converting each character and operation into a sequence using only the six allowed characters. It uses JavaScript's type coercion: [] represents an empty array (which is truthy), ![] represents false, !![] represents true, and arithmetic operations can construct numbers. Strings are built character by character using these primitives, and function calls are constructed using bracket notation.

What are the limitations of JSFuck?

JSFuck has significant limitations: the encoded code is extremely verbose (often thousands of times larger than original), it has poor performance due to the overhead of constructing values, it's difficult to read and debug, it may not work in all JavaScript environments, and it's primarily a novelty rather than a practical encoding method. The encoded code will execute, but it's not suitable for production use.

Can JSFuck code be decoded back to readable JavaScript?

Yes, JSFuck code can be decoded by executing it in a JavaScript environment and capturing the output, or by using specialized decoders that understand the JSFuck encoding pattern. However, the original variable names and code structure are lost during encoding, so the decoded code may not be identical to the original, but it will be functionally equivalent.

Related documentation

JSFuck Encoder

Open the tool to try these features.

Open tool