🔒 JavaScript Obfuscator
Protect your JavaScript by renaming variables and functions to meaningless names and converting string literals to escape sequences. Runs entirely in your browser — no upload.
About the JavaScript Obfuscator
This JavaScript obfuscator runs entirely in your browser. It tokenizes your source code and applies two transformations: identifiers declared with var, let, const, and function are renamed to meaningless names like _0x3a1f, and string literals are converted to hexadecimal escape sequences like \x68\x65\x6c\x6c\x6f. The result still runs identically but is much harder for a human to read or reverse-engineer. Nothing is uploaded to a server.
Options explained
- Rename identifiers — Replaces declared variable, parameter, and function names with generated tokens. Property accesses (after a dot) and reserved keywords are left untouched.
- Escape strings — Rewrites every character inside string literals as a
\xHHescape so the literal is not greppable in plain text. The runtime value is identical. - Remove comments — Strips
//and/* */comments before obfuscation so hints and author notes are not leaked.
How to use the obfuscator
- Paste your JavaScript into the input box.
- Tick the options you want to apply.
- Click Obfuscate to produce the protected output.
- Check the stats line for original size, obfuscated size, and how many identifiers were renamed.
- Click Copy to copy the result, or Clear to start over.
Frequently asked questions
Does obfuscation encrypt my code? No. Obfuscation makes code harder to read, but it is reversible by a determined analyst. For genuine secrecy, use encryption and keep secrets on a server.
Will the obfuscated code still run? Yes. The transformations preserve runtime behaviour — only names and string representations change. Test the output before shipping.
Are global variables renamed? Declarations at the top level of the script are renamed too, but references from other scripts or HTML attributes may break. Wrap your code in an IIFE for the safest results.