Online tools Toolshu.com Log In Sign Up

JavaScript Obfuscator Tool

  • Copy & Paste JavaScript Code
  • Upload JavaScript File
  • Output
Click to upload a JavaScript file, or drag and drop files here

Preset Configuration

Basic Configuration


Prevent Formatting Threshold:

Dead Code Injection Threshold:

Rename Properties Mode:

Reserved Variable Names:

Identifier Name Generation Rule:

* Identifier: This is the name of a variable, function, and so on in your code

Identifier Prefix:

Identifier Prefix:

String Settings

String Array Threshold:

String Array Indexes Type:

Transform String Array Calls Threshold:

String Array Wrappers Count:

String Array Wrappers Type:

Maximum Parameters for String Array Wrappers:

String Array Encoding Type:

Split Strings Chunk Length:

Force Transform Strings:

Reserved Strings:

Additional Configuration

Debug Protection Interval (ms):

Target Runtime Environment:

Random Seed:

Whitelisted Domains:

Redirect URL for Non-whitelisted Domains:

Source Map Mode:

Source Map Base URL:

Source Map File Name:

Instructions for use
Configuration Item Description Notes
Compact into One Line Compresses the obfuscated code into a single line. This reduces readability and makes the code harder to debug. Enabled by default. Disable if you need formatted code for debugging.
Simplify Code Structure Simplifies the code structure by removing unnecessary constructs and optimizing the code. Enabled by default. May break code if disabled in complex scripts.
Prevent Formatting Adds anti-formatting measures to make the code harder to beautify or reformat. Requires Prevent Formatting Threshold to be set (default: 0.75).
Dead Code Injection Injects dead code (unreachable code) to confuse reverse engineers. Requires Dead Code Injection Threshold to be set (default: 0.4).
Rename Properties Renames object property names to make the code harder to understand. Use safe mode to avoid breaking code. unsafe mode may cause runtime errors.
Obfuscate Global Variables and Function Names Renames global variables and functions to obscure their purpose. May break code if global variables are referenced externally.
Reserved Variable Names Specifies variable names that should not be obfuscated (e.g., ^someVariable or RegExp). Useful for preserving critical variable names.
Identifier Name Generation Rule Sets the rule for generating obfuscated variable names (e.g., hexadecimal, dictionary, mangled). Choose dictionary for custom names or hexadecimal for random names.
Identifier Prefix Adds a prefix to all obfuscated identifiers (e.g., a_). Optional. Useful for avoiding conflicts in multi-file projects.
Identifier Dictionary Provides a list of custom names for obfuscated identifiers (one per line). Only works if dictionary mode is selected in Identifier Name Generation Rule.
Use String Array Extracts string literals into an array and replaces them with references. Enabled by default. Disable if performance is critical.
String Array Threshold Sets the probability (0 to 1) that a string will be added to the string array. Default: 0.75. Lower values reduce obfuscation but improve performance.
String Array Rotate Rotates the string array by a random offset to obscure the order of strings. Enabled by default. Disable for faster performance.
String Array Shuffle Randomly shuffles the string array to make it harder to reconstruct. Enabled by default. Disable for faster performance.
String Array Index Shift Adds a random offset to string array indices to obscure access patterns. Enabled by default. Disable for faster performance.
String Array Indexes Type Sets the format of string array indices (e.g., hexadecimal numbers or strings). Default: hexadecimal-number. Use hexadecimal-numeric-string for stronger obfuscation.
Transform String Array Calls Transforms calls to the string array to make them harder to detect. Requires String Array Calls Transform Threshold to be set (default: 0.5).
String Array Wrappers Count Sets the number of wrappers around the string array. Default: 1. Increase for stronger obfuscation but slower performance.
String Array Wrappers Type Sets the type of wrappers (e.g., variable or function). Use function for stronger obfuscation but slower performance.
Maximum Parameters for String Array Wrappers Sets the maximum number of parameters for string array wrappers. Default: 2. Increase for stronger obfuscation but slower performance.
Chained Calls for String Array Wrappers Enables chained calls between string array wrappers. Enabled by default. Disable for faster performance.
String Array Encoding Type Encodes string array values using base64 or rc4. Use rc4 for stronger obfuscation but slower performance.
Split Strings Splits strings into chunks of a specified length to obscure their content. Set Split Strings Chunk Length to control chunk size (default: 10).
Use Unicode Escape Sequence Converts strings to Unicode escape sequences to obscure their content. Increases code size significantly. Use only for small scripts.
Force Transform Strings Forces specific strings to be transformed (e.g., ^some *string *or RegExp). Useful for targeting specific strings for obfuscation.
Reserved Strings Specifies strings that should not be transformed (e.g., ^some *string *or RegExp). Useful for preserving critical strings.
Numbers to Expressions Converts numbers into arithmetic expressions to obscure their values. May increase code size and reduce performance.
Transform Object Keys Obfuscates object keys to make the code harder to understand. May break code if object keys are referenced externally.
Disable Console Output Disables console.log and similar functions in the obfuscated code. Useful for production environments.
Self Defending Makes the code unreadable if someone tries to reformat or modify it. Forcibly enables Compact into One Line mode. Use with caution.
Debug Protection Prevents debugging by causing infinite loops or crashes in debuggers. Set Debug Protection Interval to control the frequency of protection.The recommended value is 2,000 to 4,000 milliseconds.
Ignore Imports Prevents obfuscation of import statements. Useful for preserving module imports.
Target Runtime Environment Sets the target environment for the obfuscated code (e.g., browser, Node.js). Choose browser-no-eval to avoid using eval.
Random Seed Sets a seed for the random generator to produce repeatable obfuscation results. -
Whitelisted Domains Restricts code execution to specific domains (e.g., www.example.com). Multiple domains can be specified, one per line.
Redirect URL for Non-whitelisted Domains Specifies a URL to redirect to if the code is run on a non-whitelisted domain. Default: about:blank.
Enable Source Map Generates a source map for debugging the obfuscated code. Useful for debugging but may expose original code structure.
Source Map Mode Sets the source map generation mode (e.g., inline or separate file).

inline - add source map at the end of each js code;
separate - generates corresponding '.map' file with source map. //# sourceMappingUrl=file.js.map.
Use inline for simplicity or separate for production.
Source Map Base URL Sets the base URL for the source map file (e.g., http://localhost:3000). Required if Source Map Mode is set to separate.
Source Map File Name Sets the name of the source map file (e.g., example). Required if Source Map Mode is set to separate.
Comment area