Step-through code visualizerPython · C++ · Java

See what your code is actually doing

Stop guessing what your code does. Paste an algorithm and watch it execute one line at a time. Watch every step, trace every change, and see the logic behind your algorithm.

Browse examples
  • Free
  • No sign-up required

01Demo

The product, running.

Three real sorts, traced step by step. Switch programs, change the input, scrub the timeline, the workspace behaves exactly like this, with your code in place of ours.

running
  1. def bubble_sort(arr):
  2. n = len(arr)
  3. for i in range(n - 1):
  4. swapped = False
  5. for j in range(n - 1 - i):
  6. if arr[j] > arr[j + 1]:
  7. arr[j], arr[j + 1] = arr[j + 1], arr[j]
  8. swapped = True
  9. if not swapped:
  10. break
  11. return arr
Every colour, tag and counter here means the same thing in the workspace.How to read a step

02What gets drawn

Every structure, drawn as what it is.

Not a table of variables with an array hiding in one row. The tracer recognises the shape your data actually has and each kind gets the drawing that makes its behaviour obvious.

ArrayA bubble sort pass: arr[j] and arr[j + 1] compared, then swapped — two cells, not the whole row.
Linked listReversal in place: prev, curr and nxt walk the chain, turning one arrow round per pass.
Binary search treesearch(40): the recursion’s path down, and the answer handed back up.
GraphBreadth-first: the frontier widening one ring at a time.

Also drawnstacksqueues & dequeshash maps & setsgrids & DP tablesdoubly & circular listsdirected & weighted graphsadjacency matricesobjects & pairsthe call stack

03Examples

Start from something that already runs.

Classic algorithms in Python, C++ and Java, small enough that every step is worth watching. Pick one and it opens mid-trace.

GuidesRead the step-by-step write-ups for 18 classic algorithms

Stop guessing what line 14 did.

Paste the solution you are stuck on and watch it run. One click, nothing to install.

Or read a guide first

Free · no account required