🗼Tower of Hanoi Moves Calculator

Calculate the minimum moves for the Tower of Hanoi (2^n minus 1) and estimated solve time from the disk count

disks
sec

How to Use the Tower of Hanoi Moves Calculator

The Tower of Hanoi is a classic puzzle with three pegs and a stack of disks of different sizes. The rules are simple: move only one disk at a time, never place a larger disk on top of a smaller one, and the puzzle is solved once every disk has moved to another peg. Enter the number of disks and this calculator returns the minimum number of legal moves, along with the total estimated time based on how long each move takes.

The minimum number of moves is always 2^n minus 1, where n is the disk count. Every additional disk more than doubles the required moves — a textbook case of exponential growth. Ten disks need just 1,023 moves, but twenty disks jump to 1,048,575. Because of this dramatic growth curve, the Tower of Hanoi is a go-to example when teaching recursion and exponential functions.

In the famous "end of the world" legend, monks are said to be moving 64 disks, and the world ends once they finish. Moving one disk per second without stopping would still take roughly 585 billion years — so there's genuinely nothing to worry about.

Frequently Asked Questions

How long would 64 disks really take?

With 64 disks and one move per second, you'd need 2^64 minus 1 moves — about 585 billion years. That's far longer than the age of the universe, which is where the 'end of the world' legend comes from.

Why is the minimum-moves formula 2^n minus 1?

To move n disks, you must first move the top n-1 disks to a spare peg (2^(n-1) minus 1 moves), move the largest disk (1 move), then move the n-1 disks again (2^(n-1) minus 1 moves), totaling 2^n minus 1.