Tiny Online Tools logoTiny Online ToolssearchSearch tools…grid_viewAll Tools
Homechevron_rightReverse Engineering Toolschevron_rightJavaScript ObfuscatorJavaScript Obfuscator

JavaScript Obfuscator

Rename local variables, hide string literals and flatten control flow in JavaScript — entirely in your browser, nothing uploaded.

Obfuscation levelBasicMediumAggressiveRenames provably-local variables and strips whitespace and comments.
infoThis is a deterrent against casual reading, not real security or encryption — it does not protect secrets. Everything runs locally in your browser; nothing is uploaded.

Similar Tools

JavaScript Deobfuscation Helper

JavaScript Deobfuscation Helper

Reverse common static JavaScript obfuscation: inline string-array lookups, decode escapes, fold constants, drop dead branches, and turn brackets into dots.

JavaScript Dead Code Analyzer

JavaScript Dead Code Analyzer

Paste a JS bundle and find top-level functions with no static reference anywhere in the file — a heuristic reachability scan, not a certainty.

Binary String Extractor

Binary String Extractor

Extract printable ASCII and UTF-16LE strings from any binary file, with byte offsets, a minimum-length control and live filtering.

JavaScript Formatter

JavaScript Formatter

Format JavaScript code for readability.

Random UUID List

Random UUID List

Generate large lists of UUIDs directly in your browser.

Source Map Explorer

Source Map Explorer

Load a .map file and map any generated line and column back to the original file, line and source name it came from.

Strong PIN Generator

Strong PIN Generator

Generate secure PIN codes while avoiding obvious repeated or sequential patterns.

apps

More Tools

Browse our full collection of free online tools.

What this tool does

This obfuscator parses your code with acorn into a syntax tree, applies a few structural transforms, and regenerates JavaScript with astring — entirely in your browser. Nothing you paste is ever uploaded.

Be clear about what "obfuscation" means here: this is a deterrent against casual reading, not encryption and not real security. Anyone willing to run your code and inspect it (or just spend a bit more time reading it) can still recover its behavior. JavaScript that ships to a browser is always downloadable and always executable by the person receiving it — no transform can change that. Use this to make casual copy-paste and skimming harder, not to protect secrets. Never put real secrets (API keys, credentials) in client-side JavaScript, obfuscated or not.

The three levels

Basic renames every identifier the tool can prove is locally bound — function parameters, and var/let/const declarations inside a function — using a real lexical scope analysis, not a guess. Anything that resolves to a global or an external reference is left exactly as written, on purpose: renaming those would break your code. Whitespace and comments are also stripped as part of regenerating the source.

Medium does everything Basic does, plus it collects every string literal used as an expression into one array at the top of the file and replaces each occurrence with a call like _fn(3) that looks the string up by index.

Aggressive does everything Medium does, plus every string in that array is written with \x / \u escapes instead of plain characters, and straight-line runs of three or more statements are rewritten into a while(1) { switch(_i) { ... } } dispatcher loop, so the code's structure no longer reads top-to-bottom.

Correctness first

Every level is built to produce code that runs identically to what you pasted in. Where a construct can't be proven safe — destructuring patterns, eval, with — the tool skips renaming it rather than risk breaking your program. If your code contains eval or with, a notice tells you renaming was skipped entirely for that reason.

Reading the size numbers

The stat row shows the exact input and output byte counts and the percent change. Renaming and string extraction usually increase size a little (longer generated names, an extra array and accessor function) even though the code becomes harder to skim — obfuscation and minification are different goals.

Typical uses

  • Making a small utility script less trivial to skim before sharing a demo or a CodePen.
  • Learning how obfuscators work by comparing input and output side by side.
  • Adding a light deterrent to a client-side script where the logic itself isn't sensitive.

Paste JavaScript, pick a level, and copy or download the result.