Advertisement

Make your JavaScript hard to read and copy — rename, encode strings, and compact your code right in the browser. Nothing is uploaded. Free.

Everything runs in your browser — your code never leaves your device.

Options
source.js
1
Source
obfuscated.js

							
Obfuscated code appears here
Obfuscated

Obfuscation deters casual reading; it is not encryption or real security.


About JavaScript Obfuscator

The JavaScript Obfuscator makes your source code hard to read and casually copy, directly in the browser. It tokenizes your script and rewrites it: string literals become hex and unicode escape sequences, numbers turn into hex or XOR expressions, whitespace is compacted, and an optional self-defending wrapper resists reformatting.

Each transformation is a toggle — Encode strings, Obfuscate numbers, Compact (minify) and Self-defending wrapper — so you control the trade-off between readability and output size. The tool reports the size change as a percentage, and you can copy the result or download it as obfuscated.js.

Everything runs client-side, so your unreleased code never leaves your device. Keep in mind that obfuscation deters casual reading; it is not encryption and should not be treated as a security measure for secrets or license checks.

How to use JavaScript Obfuscator

  1. Paste your JavaScript into the Source pane, or click Sample to try it with example code.
  2. Pick your options: Encode strings, Obfuscate numbers, Compact (minify) and Self-defending wrapper.
  3. Review the obfuscated output and the reported size change.
  4. Click Copy, or Download to save the result as obfuscated.js.
  5. Test the obfuscated file in your project to confirm it still behaves identically.

Frequently asked questions

Encode strings rewrites string literals as \x and \u escape sequences, Obfuscate numbers converts numeric literals into hex or XOR expressions, Compact strips whitespace like a minifier, and the self-defending wrapper makes the output harder to reformat and inspect.

Yes. The transformations preserve program behavior — strings decode to the same characters and number expressions evaluate to the same values at runtime. Still, test the output before shipping it, as with any build step.

No. Obfuscation only deters casual reading and copy-pasting; a determined person can reverse it. Never rely on it to hide API keys, credentials or licensing logic.

No. The obfuscator runs entirely in your browser, so your code never leaves your device — safe for proprietary or unreleased scripts.

Yes, it is free with no credit cost, no account and no size-based paywall.

Need help?
Found an issue with this tool? Let our team know.
Report an issue

Add this free tool to your own website — copy and paste the code below.