Skip to content
Security Runs offline

JavaScript Obfuscator

Compact and lightly obfuscate JavaScript entirely in your browser - no code ever leaves your machine.

Level

Input

0 chars

Output

0 chars
Ctrl

Questions

How does the tool tell a regex literal from a division sign?

It uses the standard heuristic real minifiers use: a "/" starts a regex when the previous token is the start of input, an operator, an opening bracket, a comma/semicolon/colon/exclamation mark, "&&"/"||", a question mark, or a keyword like return/typeof/new/case/yield. Otherwise it's treated as division. This covers the overwhelming majority of real code correctly but is a heuristic, not a full parser - a contrived snippet can theoretically fool it (for example unusual keyword sequences the heuristic doesn't recognise as regex-preceding), so always verify obfuscated output runs before deploying it.

Why aren't strings inside template literals extracted into the string array at Medium/High level?

Template literals can contain arbitrary interpolated expressions (`${...}`), including nested template literals, so safely rewriting only their literal text without touching the interpolation is significantly harder than handling a plain quoted string. This tool deliberately only extracts plain single- and double-quoted string literals and leaves template literals exactly as written - a known, intentional scope limit rather than an oversight.

Does High-level identifier renaming understand variable scope?

No - it's a whole-file heuristic, not real lexical-scope analysis. It only renames a name if it found an actual var/let/const/function/parameter declaration for it in the file, and it permanently excludes any name that also ever appears in property-access position (after a dot, or after "this.") or as an object key/label (before a colon), since a token stream alone can't prove those are the same identifier. The deliberate failure mode is under-renaming: some legitimate local names are left alone (always safe, just less thorough) - the tool is built to never incorrectly rename something, even at the cost of renaming less than a true scope-aware obfuscator would.

Is "Opaque predicate wrapping" the same as real control-flow flattening?

No, and this is deliberate - the control is named accordingly. True control-flow flattening restructures a function's statements into a dispatcher/state-machine loop, which needs real control- and data-flow analysis to do without breaking early returns, breaks, or continues that cross block boundaries. This tool instead wraps some top-level statement groups (skipping any that declare a block-scoped let/const/class/function, since nesting those in a new block would change their scope) in an `if` whose condition is an always-true arithmetic identity built from concrete numbers. It's a modest, genuinely zero-risk obfuscation, not flattening - if you need real control-flow flattening, this tool does not provide it.

Open PHP Source Encoder / Obfuscator

PHP Source Encoder / Obfuscator

Obfuscate PHP by stripping comments and renaming identifiers, or encrypt it with real AES-256-GCM - all client-side.

Security
Open Code Formatter

Code Formatter

Format or conservatively minify HTML, CSS, JavaScript, JSON, XML, SQL and PHP, one tool for all seven.

Developer