What is a Recursion Tree Visualizer?
A recursion tree visualizer draws each recursive call as a node, then shows how calls expand and return. It is useful for understanding recursion depth, branching, base cases, repeated work, and call stack behavior.
This page includes factorial, Fibonacci, and binary recursion examples so you can compare linear recursion with branching recursion.
For the full cluster of related tools, browse the Data Structure Visualizers hub.
How to use this recursion visualizer
- Choose a recursion example.
- Pick an input size.
- Build the call tree.
- Step through calls and returns.
- Inspect the active call stack and final return value.
The call tree shows the shape of recursion. The call stack shows what is currently active at a specific step.
Recursion tree vs call stack
A recursion tree shows all calls that happen across the whole execution. A call stack shows the current chain of active calls at one moment.
If you are comparing recursion with stack-style iteration, use the Stack and Queue Visualizer. For recursive choice trees and undo steps, try the Backtracking Visualizer. For branching recursion that becomes dynamic programming, try the Knapsack DP Visualizer.