This tool runs a small piece of pseudocode one statement at a time and records the result as a trace table. Each row shows every variable after that step, and each decision is explained in words.
You can trace by hand first, then run the tool and compare your table with its table.
How do you use it?
- Pick an algorithm from the list, or edit the code in the text box. The six starting algorithms are: sum of 1 to 5, largest of three numbers, halving until below 1, grade with nested IF, REPEAT UNTIL doubling, and a faulty loop that never ends.
- Predict first. On paper, write the variables as column headings and fill in the table yourself.
- Press Trace it. Reset returns to the first algorithm.
- Compare row by row. Where your table differs, read the “What happened” note for that row.
The supported statements are assignment (← or <-), OUTPUT, IF/THEN/ELSE/ENDIF, WHILE/DO/ENDWHILE, REPEAT/UNTIL and FOR/TO/STEP/NEXT. It understands + - * / DIV MOD, AND OR NOT and comparisons.
How do you read the result?
The heading says whether the program finished normally and in how many steps. Under it is the trace table with one column for each variable, plus an Output column.
Loop headers are logged each time they are checked. A WHILE line appears once more than the body runs, because the last check is the false one. A REPEAT UNTIL condition appears after each pass of the body.
Example walk-through
Choose Sum of 1 to 5. It sets total to 0, then runs a FOR loop with i from 1 to 5 adding i each time.
Expect twelve steps. Step 1 sets total to 0. Then each value of i produces two rows: one for the FOR line (i = 1, 2, 3, 4, 5) and one for the addition.
The total column reads 1, 3, 6, 10, 15. The last row is OUTPUT with 15.
Now choose Grade with nested IF. The mark is 67. The first test, mark >= 80, is FALSE, so the ELSE part runs.
The inner test, mark >= 60, is TRUE, so grade becomes 2. The trace shows both decisions and the output 2.
Finally, choose Faulty loop (never ends). x is 0 and the loop runs while x < 5, but nothing inside changes x.
The tool prints 0 again and again, stops at the safety limit and explains why. Add a line x <- x + 1 inside the loop and run it again: the output becomes 0, 1, 2, 3, 4.
What are the assumptions and limits?
- It supports a restricted notation only. Real exam pseudocode may use features that this tool does not recognise.
- The 2026 to 2028 notation needs a source check, and this tool is not the default for papers that move to Python only. Confirm the exam year with your centre and the Cambridge syllabus.
- Programs are stopped at 300 steps, and only the first 100 rows are displayed.
- Variables must have a value before they are used. The tool says so if not.
- Use original practice algorithms. It is not an exam tool and does not check assessed work.
Which lessons explain the result?
For the idea of tracing, read trace a sequence with a state table. Loops are covered in trace a count-controlled loop and trace a condition-controlled loop. When your trace is one step off, see repair an off-by-one error.
Notation and year questions are in use the verified 2026-2028 convention and check the exam year before choosing notation. For loops that never end, read repair a pseudocode loop termination condition.
The full topic is in pseudocode for the applicable syllabus. If you would like a teacher to watch your tracing, see online one-to-one Computer Science tuition. More tools are in the learning tools directory.