Protect your JavaScript
Turn readable JavaScript into code that works the same but is very hard to understand, copy or tamper with.
- Code never uploaded
- Free, no limits
- Same behaviour
Protection
Also hides strings and scrambles the logic. Good protection, about 1.5× slower.
Your JavaScript
Obfuscated
How to obfuscate JavaScript
- 01
Paste your code
Paste JavaScript into the left box, or drop a .js file onto the page.
- 02
Choose a protection level
Medium suits most code. Open More protection for domain lock, self-defending code and more.
- 03
Obfuscate and download
Click Obfuscate, test the result in your app, then copy it or download the file.
Features
Renamed identifiers
Variables and functions get meaningless hexadecimal names that reveal nothing about what they do.
Hidden strings
Text such as messages, keys and URLs is moved into an encoded array, so it can't be found by searching.
Control-flow flattening
Readable if/else logic is turned into a state machine that's very hard to follow.
Domain lock
Make the code refuse to run anywhere except your own domains.
Self-defending
Code that breaks itself if someone beautifies it to study it.
Private
Obfuscation runs in your browser with javascript-obfuscator. Your source code never leaves your device.
Frequently asked questions
Is my source code uploaded?
No. The obfuscator runs entirely in your browser in a background thread. Your code is never sent to a server, so it's safe for proprietary work.
Can obfuscated code be reversed?
Obfuscation makes code very hard and slow to understand, but nothing that runs in a browser can be made impossible to reverse. Never put real secrets, such as API keys or passwords, in client-side code.
Will obfuscation slow my code down?
Low has almost no effect. Medium is typically about 1.5 times slower and High 2–3 times slower, and both make files larger. Use the lowest level that protects what matters.
Why does my code break after obfuscating?
The usual cause is other code calling your functions by name. Turn off Rename globals, or keep public functions on an object like window.myLib. Also check that the original code has no syntax errors.
Should I minify or obfuscate?
Minify to make code smaller and faster to load. Obfuscate to make it hard to read. Obfuscated code is usually larger, so don't use it just to save space.
Which JavaScript versions are supported?
Modern JavaScript up to ES2022, including classes, async/await and modules. Compile TypeScript or JSX to JavaScript first.
Related tools
- Code MinifierMinify JavaScript, CSS, HTML and JSON to make them smaller.
- Dev FormatterFormat JSON, encode Base64 and URLs, and decode JWTs.
- Password GeneratorCreate strong passwords and passphrases you can trust.