Write TypeScript online and inspect JavaScript

Experiment with TypeScript syntax without creating a local project. Transpile a snippet, run the resulting JavaScript and inspect the console.

No account needed for browser-local experiments. Cloud saving is optional.

main.ts
type Person = { name: string; active: boolean };
const people: Person[] = [{ name: "Subo", active: true }];
console.log(people.filter(person => person.active));
Expected output
[{"name":"Subo","active":true}]

A focused TypeScript editor

Try typed parameters, object shapes and small functions.

Console output

Run the transpiled JavaScript in an isolated browser worker.

Keep a draft

Save locally or export the source to continue in your editor.

How to use this tool

  1. Open the playground and select TypeScript.

  2. Write a short snippet with console.log calls.

  3. Press Run and inspect the output or available syntax error locations.

Limits and requirements

This tool transpiles TypeScript; it is not a complete project type checker. Type annotations disappear before execution. Network access and imports are blocked in the quick worker, and execution has a three-second limit.

Practice exercises

Filter active users

Write activeNames(users: User[]): string[] so that it returns the names of the active users. Print the result joined by a comma and a space.

Load the starter

Write a generic first() function

Write a generic function first<T>(items: T[]): T | undefined that returns the first item of an array, or undefined for an empty array. Print the result for a number array, a string array and an empty array.

Load the starter
Browse TypeScript practiceSee all practice exercises

Frequently asked questions

Will my source be saved?

Local drafts stay in this browser’s storage. Export a ZIP or source file to keep a separate copy. Cloud saves need a configured account and are sent to the site’s database.

Does this use AI?

Running code in this playground does not call an AI provider.

Can I use real account credentials in sample code?

Use test data for experiments. Browser code, source exports, console messages, and debug reports can expose values you put in them.