JavaScript Obfuscator Online - Obfuscate JavaScript Code

Obfuscate your JavaScript code online. Rename variables, string extraction and encryption, control flow flattening, and more.

The JavaScript obfuscator is designed to obfuscate JavaScript code. Obfuscation is the process of transforming code into a more complex and difficult-to-understand form, while still maintaining its functionality. The primary purpose of obfuscating JavaScript code is to make it more challenging for humans to comprehend and reverse-engineer, while preserving its execution behavior.

  • Variable renaming: The obfuscator changes the names of variables, functions, and other identifiers to arbitrary and meaningless names. This makes it harder for someone to understand the purpose and logic of the code by simply reading it.
  • String extraction and encryption: The obfuscator may extract string literals from the code and replace them with shorter references, making the code more concise. Additionally, it can encrypt these strings to further obscure their meaning, requiring additional effort to understand their content.
  • Control flow flattening: The obfuscator modifies the control flow of the code by introducing complex branching structures. It transforms the original code's linear execution flow into a convoluted structure, making it difficult to follow the logical path.
  • Code transformation: The obfuscator may apply various transformations to the code, such as code splitting, dead code insertion, or code duplication. These techniques introduce additional complexity and redundancy, making the code harder to analyze.

Example 1: Variable Renaming

JavaScript Input:

JavaScript Output:

In this example, the variable names in the original code (a, b, result) have been replaced with arbitrary and meaningless names. This makes the code more difficult to understand and follow, especially when the original intention of the variables is not apparent.

Example 2: Control Flow Flattening

JavaScript Input:

JavaScript Output:

In this example, the control flow of the original code has been flattened.

These examples demonstrate how obfuscation techniques can alter and obscure the original JavaScript code, making it more challenging to understand, modify, or reverse-engineer.