JavaScript Obfuscator — Raise the Reading Cost, Not Encryption
Obfuscate JavaScript in your browser with the javascript-obfuscator default preset. The tool moves strings into a rotated array, renames identifiers to hexadecimal and compacts the output, making code harder to read — it is not encryption and cannot make code impossible to reverse. No uploads and no option switches.
What this obfuscator does — and doesn't do
Obfuscation is a readability barrier, not encryption
The output is still ordinary JavaScript that any browser can run and any developer can beautify. It raises the time cost of reading, but does not hide logic, protect secrets or prevent deobfuscation.
Uses the library's default preset
Enabled: string array with rotation, shuffling and index shifting (0.75 threshold), hexadecimal identifier names, compact output and simplification. Disabled: control flow flattening, dead code injection, debug protection, self-defending code, global renaming and Unicode escaping.
Runs entirely in your browser
Code is processed with javascript-obfuscator inside this tab. Nothing is uploaded, so source from private projects stays on your device.
One button, predictable behaviour
This page intentionally exposes no option switches; it always applies the same conservative preset so output stays compatible and does not silently become much larger or slower.
Output you can paste anywhere
The result is plain JavaScript. Copy it into DevTools, a build step or a file, then run your test suite before shipping.
Frequently asked questions
Does obfuscation make my code secure?
No. Obfuscation only increases the effort of reading the code. It is not encryption, it has no key, and a determined person can beautify and trace it. Never put API keys, passwords or proprietary algorithms in client-side JavaScript — use server-side checks and access control instead.
Which options are enabled by default?
This page calls javascript-obfuscator with no custom options. Defaults include compact output, hexadecimal identifiers, simplification, and a string array with rotate, shuffle and index shift at a 0.75 threshold. Control flow flattening, dead code injection, debug protection, self-defending, renameGlobals, numbersToExpressions, transformObjectKeys and unicodeEscapeSequence are off.
What does the string array actually do?
String literals are moved into an array, replaced by indexed lookups, and the array is rotated and shuffled by a small bootstrap at startup. It makes searching the source for a message or URL harder, but the strings still exist at runtime and can be recovered.
What is control flow flattening, and is it used here?
It rewrites branches and loops into a switch-driven state machine, which makes the flow much harder to follow. It is not enabled on this page: it can increase file size and CPU cost and occasionally break code. You can turn it on when using the javascript-obfuscator CLI or library directly.
Can obfuscation break my code or slow it down?
The default preset is relatively conservative, but it can still break code that relies on function names, toString(), eval or framework reflection. The string-array indirection adds a small startup cost; control flow flattening (not used here) would add more. Always test the obfuscated build.
How do I debug obfuscated code? Does this tool generate source maps?
No source maps are produced. Keep the original source, debug before obfuscation or in a development build, and only ship the obfuscated bundle after tests pass. Beautifying the output helps with structure, but identifiers stay mangled.
Can I obfuscate several files or a whole project at once?
No. This page handles one paste at a time. For multi-file builds, use the javascript-obfuscator CLI or its build-tool plugins in your pipeline.

