Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

JavaScript & TypeScript Online Compiler

Write, run and debug JS or TS snippets — safely sandboxed, nothing to install.

Developer No upload Free, no sign-up

Language

Ctrl+Enter (⌘+Enter) runs. Tab indents; press Esc, then Tab, to leave the editor. Your code is kept in this browser.

Output

Connecting to the code sandbox…

Next steps

About the JavaScript & TypeScript Online Compiler

Type or paste JavaScript, TypeScript, JSX or TSX and press Run. console.log, console.table, warnings and errors appear below the editor, together with the value of the last expression and how long the run took. An uncaught error shows its type, message and line — select it to jump to that line in the editor.

The code runs in your browser’s own JavaScript engine, inside a fresh Web Worker on a separate, isolated MySmartCoPilot sandbox origin, so a snippet can never touch this page, your data on this site or your other tabs. An endless loop is no problem either: Stop ends the run at once, and every run has a time limit. TypeScript and JSX are converted to JavaScript with Sucrase first — and Convert to JavaScript gives you that output to copy, so the page doubles as a TypeScript-to-JavaScript converter.

How to use it

  1. Choose the language (JavaScript, TypeScript, JSX or TSX), or pick one of the examples. Opening a .js, .ts, .jsx or .tsx file picks the language for you.
  2. Write your code. The editor indents, closes brackets and highlights syntax; Ctrl+F (⌘+F) searches. To move on from the editor with the keyboard, press Esc and then Tab.
  3. Press Run or Ctrl+Enter (⌘+Enter). Output appears as the program produces it. Stop ends a run that takes too long; the time limit (10 seconds by default) ends it automatically.
  4. If there is an error, select its location (for example main.ts:7:13) to jump to the line. For TypeScript, open JavaScript output to see and copy the converted code.

Examples

The last expression is the result
Input
const name = 'world';
console.log(`Hello, ${name}!`);
[1, 2, 3].map((n) => n * 2);
Result
Hello, world!
Result: [ 2, 4, 6 ]
TypeScript to JavaScript
Input
interface User { id: number; name: string }
const users: User[] = [{ id: 1, name: "Asha" }];
console.log(users.map((u) => u.name));
Result
const users = [{ id: 1, name: "Asha" }];
console.log(users.map((u) => u.name));

Types are removed and the interface’s line is left empty, so every line keeps its number and errors point to the right line of your TypeScript. The code that is left is unchanged.

Common uses

  • Trying out a JavaScript feature, a regular expression or an array method before putting it in your project.
  • Learning JavaScript or TypeScript: run examples and see exactly what each line prints.
  • Converting a TypeScript snippet from documentation or Stack Overflow into plain JavaScript.
  • Checking Intl number and date formatting, or how async/await and timers interleave.

What the runner supports

  • Everything your browser supports in a Web Worker: modern JavaScript syntax, async/await (also at the top level), fetch, timers, crypto, Intl, TextEncoder, structuredClone, typed arrays, BigInt, WebAssembly.
  • console.log, info, warn, error, debug, table, group, time/timeEnd, count and assert, formatted like Node.js ([ 1, 2, 3 ], { a: 1 }, Map(1) { … }).
  • Like Node, a run ends when your code, its result promise and every timer or fetch it started have finished; an uncaught exception or unhandled rejection ends it with an error.
  • With top-level await the code runs as the body of an async function: use return to produce a result.

What it does not do

  • No web page: document, window and the DOM do not exist in a worker. For code that changes a page, use the HTML, CSS & JS Playground.
  • No Node.js: require, fs, process and npm packages are not available, and import/export statements are not supported (the code runs as a script).
  • No type checking: TypeScript types are removed, not checked, so a type error does not stop the code from running. Run tsc in your project for type errors.
  • JSX becomes React.createElement(…) calls, so the code has to define React — the TSX example shows a small stand-in.

Limitations

  • Output is limited to 200,000 characters per run; longer output is cut with a note.
  • Time limit from 5 seconds to 2 minutes per run.
  • Code up to 300,000 characters is saved in this browser (local storage), so it is still there next time; Reset clears it. It is not synced to other devices.
  • Needs an internet connection the first time, to load the sandbox frame.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot. Your code runs in an isolated sandbox frame that is loaded from mysmartcopilot-sandbox.pages.dev, a separate MySmartCoPilot address; the code is handed to it inside your browser and never uploaded. Requests your own code makes (fetch) go straight from your browser to the addresses it uses.

Frequently asked questions

Is my code uploaded or stored on a server?

No. The code goes from this page to the sandbox frame inside your browser and runs on your device. It is kept only in your browser’s local storage, so it is there when you come back. If your own code calls fetch, those requests go directly to the addresses it names.

Which JavaScript version does it run?

Whatever your browser supports: V8 in Chrome and Edge, SpiderMonkey in Firefox, JavaScriptCore in Safari. New syntax works as soon as your browser has it. TypeScript and JSX syntax is converted by Sucrase, which handles current TypeScript syntax such as enums, generics, satisfies and parameter properties. Class decorators are left in place, so they only run where the browser itself supports decorators.

Why does document or window not exist?

The code runs in a Web Worker, which has no page to draw on. That keeps runs isolated and lets Stop end them instantly. To work with HTML elements and events, use the HTML, CSS & JS Playground.

How do I convert TypeScript to JavaScript?

Choose TypeScript (or TSX), paste the code and press Convert to JavaScript. The result appears under JavaScript output, ready to copy or download as main.js. Nothing runs when you only convert.

Why did my code stop with a time-limit message?

It was still running when the time limit was reached — usually a loop whose condition never becomes false, or a timer that keeps scheduling itself. Choose a longer limit next to the Run button if the work really takes longer.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.