See exactly how Java code runs

The Code Visualizer steps through Java line by line, showing every variable as it changes. Students stop guessing what their code does and watch it happen.

Press Play, or scrub through it yourself. Variables flash when they change.

Source line 1
1
int sum = 0;
2
for (int i = 1; i <= 5; i++) {
3
sum += i;
4
System.out.println(sum);
5
}
Stack 1 frame
main line 1
sum
0

Declare sum and initialize to 0.

Output
(no output yet)
Step 1/23

A pocket-sized debugger for teaching

Paste any short program, hit Visualize, and use the controls to scrub forward and back. Variables flash when they update. The active line is highlighted. Arrays, the call stack and printed output all update as you step.

Try it with your own code

The visualizer is free and needs no account. Open the visualizer, paste a program and step through it. Sign in with Classbrook to save it and share a link that anyone can open.

Free for every classroom