Convert any JavaScript snippet into JSFuck encoding to see how type coercion builds up values from nothing
Study the library source to learn how JavaScript handles automatic type conversion between numbers, strings, and arrays
Use the live demo at jsfuck.com to encode small scripts for educational experiments or puzzles
JSFuck is an experiment that proves you can write any JavaScript program using only six characters: [, ], (, ), !, and +. The result looks nothing like normal code. A simple alert(1) turns into dozens of lines of brackets and plus signs. Despite looking like noise, it executes correctly in any standard JavaScript environment, including browsers and Node.js. The project works by exploiting how JavaScript handles type conversions. JavaScript freely converts between numbers, strings, booleans, and arrays depending on context. For example, an empty array [] treated as a number becomes zero, and treated as a string becomes an empty string. By carefully combining these coercions with the handful of allowed characters, you can build any digit, any letter, and eventually any string or function call. The README walks through each step: how to get the number 1, how to get the word undefined, how to extract individual characters from that word, and how to eventually build method names like filter or constructor that let you run arbitrary code. This is described as an esoteric and educational project. Esoteric means it is intentionally impractical, more of a curiosity or puzzle than something you would use in real software. Educational means studying it reveals real things about how JavaScript's type system works under the hood, which is why it has attracted attention from developers curious about language internals. The library includes a conversion function so you can input any JavaScript code and get the JSFuck equivalent out. A live demo is available at jsfuck.com. The README is detailed, explaining the logic behind each character and each step in building up from simple values to complete programs.
← aemkei on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.