Online compiler, debugger and visualizer

Code visualizer

Press Visualize and your program is recorded as it runs. Each data structure is drawn the way it is taught: a stack as a pile with a top, a queue with a front and a rear, a linked list as a chain of nodes, a tree as a tree and a graph as nodes and edges. Step forward and back and watch every push, pop, insert and visit.

  • Free
  • No sign-up
  • Real compilers
  • Works on phones
main.py
def fib(n):    a, b = 0, 1    for _ in range(n):        a, b = b, a + b    return a n = int(input("How many? "))print([fib(i) for i in range(n)])

What you can do

  • Stacks and queues

    Push and pop on a stack with its top marked; enqueue and dequeue with the front and rear marked. Deques and priority queues too.

  • Linked lists

    Singly, doubly and circular lists as chains of nodes, with head, curr, prev, slow and fast shown where they point.

  • Trees

    Binary trees, binary search trees, AVL and red-black trees, N-ary trees, tries, heaps and segment trees, laid out as trees.

  • Graphs

    Adjacency lists, matrices and edge lists become nodes and edges, with visited nodes, the queue or stack, the current node and distances during BFS and DFS.

  • Hash maps and sets

    Dictionaries and HashMaps as key and value tables; sets as a group of values.

  • Arrays and DP tables

    Index variables like i, j, left, right and mid shown under the array; 2D tables with the current cell highlighted.

  • Every step recorded

    Move forward and back through the whole run, or jump to any step with the slider.

  • Memory view

    Switch to the memory view to see every object and reference as boxes and arrows.

  • Call stack

    See each function call and its local variables, which makes recursion easy to follow.

  • Line by line

    The editor highlights the line that just ran and the one that runs next.

  • Ask about a step

    Not sure why a value changed? Ask the assistant about the step you are looking at.

How it works

  1. 1

    Open the visualizer and write a short program.

  2. 2

    Press Visualize.

  3. 3

    Use the arrows or slider to move through the steps.

Questions and answers

Which languages can be visualized?

Java, Python, C, C++, JavaScript and TypeScript.

Which data structures are drawn?

Arrays and strings with index pointers, 2D arrays, stacks, queues, deques, priority queues and heaps, hash maps and sets, singly, doubly and circular linked lists, binary trees, binary search trees, AVL and red-black trees, N-ary and ternary trees, tries, segment trees, and graphs from adjacency lists, adjacency matrices, edge lists or node objects.

Do I have to change my code?

No. Structures are recognised from the program as it runs: Java collections like ArrayDeque, PriorityQueue and HashMap, Python lists, deques, dicts and sets, JavaScript arrays, Maps, Sets and plain objects, and your own node classes or objects with fields such as next, left and right, or children.

Is it free?

Yes. Running, debugging, tests and live sessions are free, with no sign-up.

Where are my projects saved?

In your browser, on your device, automatically as you type. Nothing is lost when you close the tab. They stay until you delete them.

Is my code safe to run?

Every program runs in its own isolated sandbox with no internet access and strict limits on time, memory and processes, and is deleted when it finishes.

Compilers and tools