Code tool

JS Interpreter

Try short JavaScript snippets in a fresh sandbox for every run. Choose expression or script mode, inspect console output, and stop execution at any time.

In-browser processingNo account requiredPrivacy details ↗

Fresh run each time · maximum 50,000 characters · 2-second deadline · no DOM, network, site storage or imports. Script mode uses console output and an optional return.

Output

A QUICK WALKTHROUGH

How to use this tool

  1. Enter code or load an example.
  2. Choose Expression for a value, or Script for statements and an optional return.
  3. Run the code and review the output or error. Use Stop to end a running snippet.

Two execution modes

Expressions return their value. Scripts run in an async function body: console.log, console.info, console.warn and console.error produce output; use return for a final value. Await is supported in either mode. The browser determines JavaScript syntax support.

Isolated and limited

Code runs only in a dedicated worker created inside an iframe with sandbox="allow-scripts", without same-origin permission. Its CSP blocks network connections and external scripts. There is no page DOM, site storage, navigation, popup or download access. Each run has a 2-second deadline, a Stop control, a 50,000-character input limit and at most 100 output lines / 32,000 characters.

Fresh local runs

Code and results are not uploaded or saved. Variables do not persist across runs. Timers are discarded when the returned value or promise completes. No packages, remote imports, HTML rendering, filesystem or Node.js APIs are provided. Browser memory use cannot be strictly capped; use small snippets.

GOOD TO KNOW

Common questions

Can I access the page or fetch an API?

No. The worker has no document or window, and the sandbox CSP blocks network access and imports. It cannot read the main page’s storage.

How do I stop an infinite loop?

Select Stop. An independent iframe timer also terminates the worker after 2 seconds, including code that blocks the worker event loop.

Does this preserve a REPL session?

No. Every run starts fresh. Put dependent statements in the same script. Use explicit return for its final result.

What happens if sandbox setup fails?

Execution is refused. The tool never falls back to running your code in the main page.