ToolsForcebeta

$ run --tool

Recursion Visualizer

Watch the call stack grow and unwind step by step for Factorial, Fibonacci, Sum of Digits, Power and GCD.

Complexity —Time O(n)Space (call stack) O(n)

Features

  • 5 classic recursive functions: Factorial, Fibonacci, Sum of Digits, Power, GCD
  • Visual call stack that grows on each call and unwinds on each return
  • Time and space complexity shown for each function
  • Play/Pause with adjustable speed, or step manually

How to use

  1. 1Pick a recursive function and enter its input(s)
  2. 2Click Run to generate the full call sequence
  3. 3Step through with Next/Prev or Play to watch the stack grow and unwind

Frequently asked questions

Why is Fibonacci limited to a small n?+

Naive recursive Fibonacci makes an exponential number of calls — keeping n small keeps the stack visualization readable instead of generating thousands of steps.

How is this different from the DSA Visualizer?+

This tool focuses specifically on how recursive calls stack up and return, rather than sorting/searching arrays or stack/queue operations.

Related tools

Need a tool that isn't here yet?

ToolsForce is growing every week. Tell us what to build next.

Request a tool