About this TypeScript compiler
This free online TypeScript compiler turns your TypeScript into JavaScript and runs it straight away, so you can try interfaces, generics and enums without setting up a project.
It is built for learning and quick tests. Press Run and the output of console.log appears on the right. Because everything happens in your browser, there is nothing to install and no account to make.
How to use it
- Write your TypeScript in the editor, including type annotations, interfaces and generics.
- Press Run (or Ctrl + Enter).
- The types are removed and the resulting JavaScript is executed. Output from console.log appears in the output panel.
- Fix any errors shown in red and run again.
Features
- Interfaces, generics, enums, type aliases and other TypeScript syntax
- Top-level await and modern JavaScript features
- Stop button for runaway loops
- Dark and light themes, automatic saving in your browser, download as .ts
Good to know
- Types are removed but not checked. A type mismatch will not produce an error here; use your editor or the tsc command for full type checking.
- import and export statements are not supported in a single-file run.
- Programs that run for more than about 15 seconds are stopped.
Frequently asked questions
Does this check my types?
No. It removes the type annotations and runs the JavaScript that remains. Syntax errors are reported, but type errors are not. For full type checking, use the TypeScript compiler (tsc) in your own project.
Can I use import statements?
Not in this single-file editor. Put your code in one file and it will run.
Does it support enums and generics?
Yes, both work, along with interfaces, type aliases, abstract classes and most other TypeScript syntax.
Is it free to use?
Yes, with no sign-up. Your code runs in your own browser.