JS Obfuscator

Obfuscate JavaScript to make it hard to read and copy

Protect JavaScript source by renaming identifiers, encrypting strings and flattening control flow, with optional domain locking, self-defending code and console removal. Runs entirely in your browser.
Try an example:

Output will appear here...

About JS Obfuscator

How it works

  1. Your code is parsed and rewritten by the javascript-obfuscator engine in your browser.
  2. Variable and function names become meaningless (_0x3a1f), strings move into an encoded array, and higher strengths scramble the control flow and add dead code.
  3. Optional extras lock the script to your domains, remove console output, or make the code stop working if someone tries to beautify it.
  4. The size stats show how much bigger and slower the result is - stronger settings cost more.

What you need

  • Valid JavaScript (ES2022 is supported). TypeScript or JSX must be compiled to JavaScript first.

Tips

  • Only rename globals if nothing outside the file (HTML onclick, other scripts) calls them by name.
  • Test the obfuscated file before deploying - especially with Medium and High.
  • Keep your original source in version control; obfuscation cannot be undone exactly.
  • Domain lock is a deterrent for copied scripts - list every domain the script runs on, including staging.

Limitations

  • Obfuscation slows people down; it does not make code secret. Never put passwords or API secrets in front-end code.
  • High strength can make code several times larger and noticeably slower.

Runs in your browser. Your code is processed in your browser and never uploaded.

Frequently asked questions

Can obfuscated JavaScript be reversed?+

Partly. Tools can reformat it and rename things back to something readable, but original names, comments and structure are lost. Obfuscation raises the effort; it is not encryption.

Will obfuscation slow my site down?+

Low adds little overhead. Medium and High add control-flow flattening and dead code, which can make the file several times larger and slower to run - use them only for small, sensitive parts.

Should I obfuscate instead of minifying?+

They do different jobs: minifying makes code small and fast; obfuscating makes it hard to read. For performance use the JS Minifier; obfuscate only when you need to protect logic.

Is it safe to hide API keys this way?+

No. Anything sent to the browser can be extracted. Keep secrets on your server and call it from the front end.