🗼Tower of Hanoi

Classic Tower of Hanoi puzzle with 3-8 discs — solve it in the fewest moves

Moves
0
Minimum
15
Fewest moves
Discs
1
2
3

Move all discs onto the rightmost peg in order — never place a bigger disc on a smaller one! · Tap a peg to pick up its top disc, then tap another peg to drop it. Keys 1/2/3 also work. A larger disc can never sit on a smaller one.

How to Use

FAQ

Is there a strategy for Tower of Hanoi?

Think recursively: to move n discs, move the top n−1 to the spare peg, move the largest disc to the target, then bring the n−1 discs over. With an odd disc count, move the smallest disc to the target peg first; with an even count, to the spare peg.

How many moves does it take at minimum?

The minimum is 2ⁿ−1 moves: 7 for 3 discs, 15 for 4, 31 for 5, and 255 for 8 discs.