DevTools Logo

TypeScript Playground

About this tool

TypeScript compiles in your browser with the official compiler, then the emitted JavaScript runs in the same sandbox as the JS playground.

There is no npm, no tsconfig project references, and no emit to disk — a typed scratchpad.

How to use this tool

  1. Write TS

    Annotations, interfaces and generics that transpileModule supports will compile.

  2. Read errors

    Compile failures appear in Output without running.

  3. Run

    Successful compiles execute in a Web Worker that Stop and timeout can terminate.

Frequently asked questions

Which TypeScript compiler is this?

The same typescript package that ships with the site, running in your browser via transpileModule. It is a snippet compiler, not tsc --build.

Are npm imports supported?

No. Paste self-contained TypeScript. There is no node_modules in the sandbox.

Is my code uploaded?

No. Compilation and execution happen in this tab.

How is this different from the TypeScript to JavaScript converter?

That tool only strips types. This playground compiles and then runs the result so you see console output.