Tower of Hanoi Game— Free Online Tower Puzzle

1
2
3
A
B
C
0
Tower Moves
Optimal Hanoi: 7
00:00
Puzzle Time
3-Disk Level
Solve Efficiency
vs optimal moves

Tower of Hanoi controls: 1 2 3 select pegs · ⌘Z undo move

What is the Tower of Hanoi Game?

The Tower of Hanoi game is one of the most elegant mathematical puzzles ever invented. Created in 1883 by French mathematician Édouard Lucas, it challenges you to move a stack of disks from one peg to another, following three simple rules: move only one disk at a time, only move the top disk of any stack, and never place a larger disk on top of a smaller one.

Despite its simple rules, the Tower of Hanoi has deep mathematical properties. The minimum number of moves required to solve an n-disk puzzle is exactly 2ⁿ − 1. That means:

  • 3 disks → 7 moves minimum (Easy)
  • 5 disks → 31 moves minimum (Hard)
  • 7 disks → 127 moves minimum (Master)
  • 8 disks → 255 moves minimum (Legend)

How do you play the Tower of Hanoi?

Click any peg to select the top disk (it will highlight), then click the destination peg to move it. You can also use keyboard keys 1, 2, 3 to select pegs, or press A, B, C. Press ⌘Z to undo.

What is the recursive solution to the Tower of Hanoi?

The Tower of Hanoi has a beautiful recursive solution: to move n disks from peg A to peg C, first move the top n−1 disks from A to B (using C), then move the largest disk from A to C, then move the n−1 disks from B to C (using A). Click Auto-Solve to watch this algorithm in action!

What is a good strategy for the Tower of Hanoi?

Think recursively. Your goal is always to free the largest remaining disk by moving everything above it out of the way. For 3 disks: move disk 1 to C, disk 2 to B, disk 1 to B, disk 3 to C, then disk 1 to A, disk 2 to C, disk 1 to C.

Is the Tower of Hanoi good for your brain?

Yes! Research shows that solving the Tower of Hanoi puzzle exercises working memory,planning ability, and recursive thinking. It's used in neuropsychological assessments and is a classic example in computer science education to demonstrate recursion and algorithm complexity.

How many moves does the Tower of Hanoi take?

The minimum is 2ⁿ − 1 moves (where n = number of disks). This is proven to be optimal — you cannot solve it in fewer moves. Our Efficiency score shows how close you are to the optimal solution: 100% means you solved it in the minimum number of moves.

© 2026 TowerOfHanoiGame.com  · How to Play  ·  Free online Tower of Hanoi puzzle game — no download required