Code Playground

Runs in your browser

Run JavaScript, TypeScript, HTML with CSS and JavaScript, Markdown and SQLite SQL in an isolated browser sandbox. Every language runs locally, network access is blocked and output is capped. No ads or analytics run on this tool.

Code

Press Ctrl/⌘+Enter to run. The code runs in a worker inside an isolated frame.

Console

0 entries

Run the example to see its output here.

JavaScript and SQL are stopped by destroying the worker.

Off by default. When on, this browser keeps the text of each language in local storage. Code is never saved on the server, and it still does not run until you press Run.

Limits

  • 200,000 characters per editor.
  • 10,000 output lines or 1 MB, then output stops.
  • 5 to 60 seconds per run.
  • SQL shows the first 200 rows of each result.

Python, PHP, Lua, Java, Go, Rust and C are not offered in this version. The FAQ explains why.

Ready

Choose a language, edit the example, then press Run. Nothing runs until you ask.

A real sandbox, not a promise

Your code runs in a worker inside <iframe sandbox="allow-scripts">. The frame has an opaque origin, so it cannot read cookies, storage or this page.

No network from your code

The frame's policy allows scripts and its own runtime files only. fetch, XMLHttpRequest and remote images are refused.

Stoppable by design

An endless loop cannot freeze the page: the worker is destroyed at the time limit, together with the frame that owns it.

What this playground is for

Use it to check a small piece of code before you put it in a project: how a reduce call behaves, why a SQL aggregate returns two rows, what a Markdown table looks like, or whether a click handler fires. The value is a fast answer without installing anything, opening a terminal or pasting code into a website that runs it on a server.

It is deliberately small. This is not a full IDE, it has no npm packages, no file system and no network, and it will not replace your project's build. TypeScript types are erased but never checked, and Python, PHP, Lua and compiled languages are not offered.

How to use the playground

  1. Pick a language in the settings panel. Each language keeps its own editor and example.
  2. Load one of the examples or open a small file. Nothing runs when you open it.
  3. Read the note under the settings; it states what that language does and does not do.
  4. Press Run, or Ctrl/⌘+Enter. Use Stop, or the time limit, to end a run that will not finish.
  5. Read the console. Errors keep their message and, where the engine provides one, the line number.
  6. Turn on “Remember this code on this device” only if you want the text kept in this browser.

Worked example: a build report

This JavaScript input is the first example in the editor:

const builds = [
  { target: 'ios', status: 'passed', minutes: 4 },
  { target: 'android', status: 'failed', minutes: 6 },
  { target: 'ios', status: 'passed', minutes: 5 },
];

const failed = builds.filter((build) => build.status === 'failed');
console.log(`Builds: ${builds.length}, failed: ${failed.length}`);
failed.forEach((build) => console.log(`${build.target}: ${build.minutes} min`));

The console prints two lines and the status bar reports the run time:

Builds: 3, failed: 1
android: 6 min

The SQL example on the same page uses a four-row apps table. Grouping by platform returns two result rows: Android with 2 apps, 1,290 downloads and an average rating of 4.3, and iOS with 2 apps, 6,450 downloads and 4.7. The numbers are computed by SQLite in the worker, not typed into the page.

Why the sandbox is built this way

Running someone else's code is the riskiest thing a developer tool can do. The browser already has a boundary for it: an iframe with the sandbox attribute and no allow-same-origin. Such a frame gets an opaque origin, so its scripts see no AppCenter cookies, no local storage and no parent document, even if the code tries.

The frame is served from a dedicated route with its own Content Security Policy. Scripts may run, eval is allowed there and nowhere else on the site, and the only permitted network destination is the self-hosted runtime folder. Your code therefore has no route to an external service, and neither does a library it might try to load.

Inside the frame, each run gets a new worker. A worker has no DOM at all, so the classic document.cookie and parent.document tricks fail before the sandbox even has to stop them. The page talks to the worker only through messages, checks that each message came from its own frame, treats the content as text and stops at 10,000 lines.

The HTML preview is a second sandboxed frame with connect-src 'none'. It can render markup, styles and scripts, but it cannot make a single request. Markdown takes a different route on purpose: it is rendered with raw HTML disabled, so a pasted <script> is displayed as text instead of being executed.

Languages, limits and common errors

Language Engine What to expect
JavaScript Browser engine in a worker Modern syntax supported by the browser you use; top-level await works.
TypeScript sucrase type stripping Types disappear; type errors do not stop a run. No JSX or decorators.
HTML, CSS and JS Sandboxed preview frame Renders and runs, but external fonts, images and requests are blocked.
Markdown markdown-it CommonMark plus tables and fenced code. Raw HTML is escaped; images become text.
SQL SQLite compiled to WebAssembly SQLite syntax, in memory, deleted when the worker ends.
  • “document is not defined”: your JavaScript runs in a worker, which has no DOM. Use console.log for output; test DOM code in the HTML mode.
  • “Failed to fetch”: the sandbox blocks every network request. That is the intended result, not a broken example.
  • A TypeScript type error did not appear: types are erased, not checked. Run tsc in your project for a real check.
  • “no such table”: the schema editor runs first. Add the table there, or select the SQL example that creates it.
  • “Stopped at the time limit”: the code was still running. Check for an endless loop or a query with no limit, then run again.
  • An image or font in the HTML preview is missing: remote resources are blocked. Inline data or use a system font.

How your code is processed

Your code stays in this tab. JavaScript and TypeScript are posted to a worker in the sandbox frame; SQL is sent to a worker that loads a local copy of SQLite; Markdown is rendered by a bundled parser; HTML is written into a sandboxed preview. No request carries your source, and the playground loads no third-party script.

Local processing protects your privacy, but it is not a code review. The sandbox protects this site from the code; it does not tell you whether the code is correct or safe to ship. Read anything you copy from elsewhere.

There are no ads and no analytics on this page, and the tool needs no account. If you enable remembering code, only this browser's local storage is used; clearing site data removes it.

Frequently asked questions

Can my code read AppCenter cookies or my other tabs?

No. The frame has an opaque origin because it is sandboxed without allow-same-origin, and the code itself runs in a worker with no DOM. Reading cookies, local storage or the parent document throws an error by design.

Can I install npm packages?

No. Only the browser's built-in APIs and the engines bundled on this page are available. There is no package manager, no file system and no network, so a package would have nowhere to come from.

Why are Python, PHP, Lua and compiled languages missing?

Running them in a browser needs a separate WebAssembly runtime for each language, often many megabytes. We only list a language once it runs reliably inside the same isolated sandbox. Today that means JavaScript, TypeScript, HTML with CSS and JavaScript, Markdown and SQLite SQL.

Why does my fetch call fail even to the same site?

The sandbox policy allows network requests only to its own runtime files. A request to any other path, and every external host, is refused. If you need to test an API, do it in your project with a local server.

Does the SQL database persist between runs?

No. Each run creates a fresh in-memory database, runs the schema editor and then your query, and deletes the database when the worker ends. Copy anything you want to keep into the editor or download it.

Is my code saved if I close the tab?

Only if you turn on “Remember this code on this device”. That setting stores the editor text in this browser's local storage; the default is off, and AppCenter never receives the text.

Related tools and sources

To tidy the code you just wrote, use Code Formatter & Minifier. For data and API payloads, use JSON & Data Studio; for a Content Security Policy like the one behind this sandbox, use the SEO & Web File Toolkit.

Sources: the HTML Standard's iframe sandbox rules, MDN's Content Security Policy and Web Workers references, the ECMAScript language specification for JavaScript semantics, the sucrase project for type stripping, SQLite's documentation for SQL behaviour and sql.js for the WebAssembly build. Security behaviour checked in Chromium, Firefox and WebKit on 29 November 2026.