← All tools

JavaScript Event Loop Visualizer

Explore a bounded JavaScript simulation of the call stack, timers, tasks and microtasks, or use the original JSON job tree.

javascript-event-loop-visualizerLOCAL WORKSPACE

Enabling local controls…

Input mode

A simplified browser event-loop model. Code is parsed and simulated locally, never executed or uploaded. Time is virtual, not a measurement or scheduling guarantee for a real browser.

JavaScript draft

Editable examples
Supported syntax and model limits

Supports strings, numbers, booleans, null, undefined, let / const declarations and simple assignment, named function declarations and calls, return, console.log, setTimeout, queueMicrotask, Promise.resolve().then, and async / await. The only binary operator is +; unary signs are supported. Callbacks may use arrow or function syntax.

Async functions can return primitive values only. Returning a Promise, loops, conditionals, objects / arrays, Promise rejections / chaining, DOM, fetch, and Node.js APIs are unsupported; the return value of then() cannot be used. This is not a complete JavaScript runtime: rendering, real timer precision, networking, and OS scheduling are not modeled.

Finish synchronous work, then drain microtasks. Drain microtasks again after each task. Waiting timers are shown separately from ready tasks.

References: MDN · HTML Standard

Event loop

Virtual time 0 ms

Load an example or edit the code, then select Run simulation.

Call stack0

Top returns first

Stack empty

Waiting timers0

Join the task queue when due

No waiting timers

Task queue0

First in, first out; microtasks go first

Task queue empty

Microtask queue0

First in, first out; drain before tasks

Microtask queue empty

Simulated console

No output at this step

Source interface reviewed2026-10-19: ToolHub

How to use this tool

Choose an example or edit the supported JavaScript subset, then run and step through the simulation. The JSON mode retains the original job-tree output.

When not to use it

The virtual model does not execute code or represent browser timing, rendering, network requests, Node.js or unsupported JavaScript syntax.