TypeScript Obfuscator

Transpile TypeScript to JavaScript and obfuscate it in one step to protect your code. Paste your code, tune the protection options, and click — everything runs on your device, nothing is sent to a server. (To pretty-print code, use the Formatter.)

The result will appear here…
or press Ctrl+Enter

Everything runs in your browser. Your code is never sent to our servers.

728 × 90Ad Space AvailablePlace your ad here

Example

Example Input

const greet = (name: string): string => {
  return `Hello, ${name}`;
};

Example Output

var _0x2b1a=['Hello,\x20'];const greet=_0x4f1c=>{return _0x2b1a[0x0]+_0x4f1c;};

How to Use

  1. 1Paste your TypeScript code into the Input field.
  2. 2Tune the protection level in the "Obfuscation options" panel as needed.
  3. 3Click the Obfuscate button (or press Ctrl+Enter). The result appears in the Output field.
  4. 4Click Copy to copy the result. To pretty-print code, use the Formatter.

About the TypeScript Obfuscator

The TypeScript Obfuscator first transpiles your TypeScript to JavaScript (type annotations, interfaces, and enums are erased since they exist only at compile time), then applies full obfuscation to the result. The final output is JavaScript that runs in any browser — because TypeScript types do not exist at runtime anyway.

This two-step approach is necessary because the obfuscator operates on JavaScript, not TypeScript type syntax. You get all the same protection options as the JavaScript Obfuscator: identifier renaming, encoded string arrays, control flow flattening, dead code, and anti-tamper options.

Remember that since TypeScript is transpiled first, type information does not carry into the output (as expected) — and this is one-way, with no path back to TypeScript. If you only need to pretty-print code, use the Formatter.

FAQ

Why is the output JavaScript, not TypeScript?

Because TypeScript types exist only at compile time and are stripped from the runnable code. The obfuscator works on runtime JavaScript, so the steps are: TypeScript → transpile → JavaScript → obfuscate. This is the standard way to protect TypeScript code destined to run in a browser.

What's the difference between obfuscating and minifying TypeScript?

Minifying only shrinks size (removes whitespace/comments) but stays easy to reverse. Obfuscating deliberately makes code HARD to read and reverse-engineer — renaming, disguising strings, and altering flow — while still running the same. For plain beautify/minify, use the Formatter.

Is there a deobfuscate mode for TypeScript?

No. The TypeScript Obfuscator is one-way — there is no deobfuscate mode. Beyond the rotated string array that needs eval to unpack (forbidden by the site CSP), transpiling from TypeScript also permanently erases types, so the output cannot be turned back into TypeScript. To pretty-print code, use the Formatter.

Is my code sent to a server?

No. TypeScript is processed entirely in your browser using JavaScript/WebAssembly. Your code never leaves your device.

Related Tools

Related Categories