toolqik

203 · JavaScript

JavaScript Playground

Run JavaScript in your browser and see console output, errors and results instantly.

Runs in your browser
Output appears here. Press Run or Ctrl + Enter.

About this tool

Type JavaScript and press Run (or Ctrl + Enter) to see what it prints. console.log, console.table, warnings and errors appear in the console panel, errors with the line they happened on, and the value of a top-level return is shown at the end. It’s handy for testing a snippet, checking how a built-in method behaves, or learning JavaScript.

What you can use

  • All modern JavaScript, including top-level await.
  • console.log, info, warn, error, table, dir, group, count, time and assert, with objects printed in a readable form.
  • Timers, fetch to APIs that allow cross-origin requests, crypto, Intl and structuredClone.

There is no document or window, because the code runs in a worker. To try code that works with a page, use the HTML Preview.

Safe to run

Your code runs in a Web Worker inside a sandboxed iframe with its own unique origin. It can’t read this site’s storage or cookies or touch the page, and an infinite loop can always be stopped, because the worker is terminated rather than asked to stop.

Press Stop at any time; code still running after 30 seconds is stopped automatically. Your code isn’t saved or uploaded. Copy link puts it in the link’s #fragment, which browsers never send to servers.

FAQ

How do I run JavaScript online?

Type or paste code into the editor and press Run or Ctrl+Enter. Console output appears next to it.

Can I use await and fetch?

Yes. Top-level await works, and fetch can reach any API that allows cross-origin requests.

Why is document not defined?

The code runs in a sandboxed Web Worker, which has no page. Use the HTML Preview to run code that works with the DOM.

What happens with an infinite loop?

Press Stop, or wait 30 seconds: the worker running your code is terminated, and the page stays responsive throughout.

Is my code saved?

No. Nothing is stored or uploaded. Copy link encodes the code in the URL fragment, which stays in your browser.

esc
↑↓ navigate↵ open