About the JavaScript Runner
Sometimes you just need to check what an expression returns or how a function behaves with a given input. This runner executes your code in a sandboxed iframe on this page, captures console.log, info, warn and error output, prints the value of the last expression if there is one, and reports uncaught errors and promise rejections. Top-level await works, and a five-second timeout stops infinite loops.
The sandbox has no access to this page, to cookies, or to any storage, and it cannot navigate the browser. It is a fresh frame each run, so state does not leak between runs. Objects and arrays logged to the console are printed as JSON so nested data is readable.
This is browser JavaScript: fetch, Intl and the DOM APIs of an empty document are available; Node modules and require are not. For syntax checking without executing, use the JavaScript Validator.
How to use
- Write or paste code on the left.
- Press Run or Ctrl+Enter.
- Read the console output on the right; errors are shown with their message.
Common questions
- Is my code sent anywhere?
- No. It runs in an iframe inside this page. You can confirm in the network tab that no request is made.
- Why does document.body look empty?
- The sandbox is an empty document. You can create elements and log their properties, but nothing is displayed.
- Can I use npm packages?
- Not directly. Code that loads a module from a CDN via dynamic import will work if the host allows it.
- What happens on an infinite loop?
- The run is stopped after five seconds and reported as a timeout.