1. Home
  2. Developer Tools
  3. TypeScript Compiler

Online TypeScript Compiler

Write TypeScript, press Run, see the output. Interfaces, generics, enums and type annotations compile and run instantly in your browser.

✓ Free✓ No Signup✓ Instant Compile✓ Generics & Enums
main.ts
Output

Press Run to see the output here.

⌘/Ctrl + EnterRun⌘/Ctrl + /Comment⌘/Ctrl + ZUndo⌘/Ctrl + Shift + ZRedoCode autosaves in this browser only — it is never sent to our servers.

Write TypeScript the way you would in a project — interfaces, type aliases, generics, union types, enums, access modifiers, as-casts and non-null assertions — and press Run. The code is compiled to JavaScript in milliseconds and executed with a Node-style console on the right.

Be clear about one thing: this compiler removes the types, it does not check them. That is the same thing esbuild, swc and Vite do on every save, and it is why compiling is instant — but a type error such as assigning a string to a number will run rather than be reported. Keep tsc or your editor for type checking; use this to see what your TypeScript actually does at runtime.

Like the JavaScript compiler, everything runs in a sandbox inside your browser: async/await and timers work, and document and fetch are deliberately unavailable.

Frequently Asked Questions

Does this online TypeScript compiler check types?

No. It strips the type annotations and runs the resulting JavaScript — the same approach esbuild and swc take. Runtime behaviour is exactly right, but type errors are not reported. Use tsc --noEmit or your editor for type checking.

Which TypeScript features are supported?

Interfaces, type aliases, generics, union and intersection types, enums (including const enums), classes with access modifiers and parameter properties, abstract classes, as-casts, satisfies and non-null assertions.

Can I see the compiled JavaScript?

Not yet — the output panel shows what the program prints. Because only the types are removed, the compiled JavaScript is your code with the annotations deleted.

Is my TypeScript code uploaded?

No. Compilation and execution both happen in your browser, and your code is saved only in your browser’s local storage.