Configurable protection
Adjust options to balance readability, size, and protection.
Developer tools
JavaScript Obfuscator makes JavaScript harder to read and copy by transforming code structure and identifiers. It's useful for client-side code you want to add friction to, while keeping in mind that browser code can still be inspected.
01 / How it works
Paste JavaScript or open a .js file.
Choose obfuscation options based on how much protection you need.
Generate the obfuscated output and copy or download it.
02 / Features
Adjust options to balance readability, size, and protection.
Your source code stays in the browser.
Use the result directly in your build or delivery flow.
Start with sensible settings, then tune when you need more control.
03 / Guide
JavaScript Obfuscator rewrites your code so it still runs the same way but is very hard for a person to read and copy. Before using it, it's worth being clear about what obfuscation can and can't do. This guide covers that, explains each setting and its cost, and lists the cases where you shouldn't obfuscate at all.
Start with the hard limit. Any JavaScript that runs in a browser has to be downloaded to the visitor's device first. Anyone can open the browser's developer tools and see it, save it, and run it. Obfuscation can't change that. It doesn't encrypt your code in a way that stops it running, and it can't hide anything the code does from a determined, skilled person with time to spare.
What it does is raise the cost of understanding the code. Variable names become meaningless, readable text is hidden, and the logic is rearranged into a tangle that does the same thing. Copying a widget, lifting a clever algorithm or tweaking a licence check becomes slow, tedious work instead of a five-minute job. For many people that's enough of a deterrent.
So the rule is simple: never put secrets in front-end code, obfuscated or not. API keys with real power, passwords, pricing rules you rely on and licence validation that matters belong on a server, where visitors can't see them.
Size and speed costs come from the extra code that obfuscation adds: wrappers that decode strings at runtime and extra branches that make the logic hard to follow. After each run, the tool shows the size before and after and how long obfuscation took, so you can compare levels on your own file.
These are off by default. Each makes reverse engineering harder, and each has a downside.
console.log and similar calls, so the code reveals less while running. It also hides your own debugging output, and can hide messages from other scripts on the page.onclick, or a framework call your functions by name, because those calls will break..example.com, to include its subdomains. Remember to include every domain you use, including staging.Each run uses a fresh random seed, so obfuscating the same file twice gives different output. Keep your readable original in version control; you'll make every future change there and obfuscate again.
eval or looks up properties by name, can break under heavy renaming.The tool uses the open-source javascript-obfuscator library, running in a background worker in your browser so the page stays responsive even on large files at High. Your code is never uploaded. To inspect what the obfuscated code contains, the Dev Formatter can decode any Base64 strings you spot in it.
04 / FAQ
No. It makes code harder to read and reuse, but determined users can still analyze client-side JavaScript.
It can if options are too aggressive. Test the output after obfuscating.
No. The obfuscation runs in your browser.
05 / Related tools