About Tower of Hanoi
The Tower of Hanoi is a famous mathematical puzzle used in classrooms and programming courses around the world. It is simple to learn and beautifully logical.
Each game has three towers: 3, 4 and 5 disks. Solving in the fewest possible moves earns a gold medal.
Tower of Hanoi at a glance
| Genre | Puzzle game |
|---|---|
| Price | Free, no download or sign-up |
| Controls | Tap |
| Typical game length | 5 to 10 minutes for 3 towers |
| Lives | None |
| Works on | Phones, tablets and computers, in any modern browser |
| Daily challenge | Yes, the same puzzle for everyone each day |
How to play Tower of Hanoi
- Tap a peg. Its top disk lifts.
- Tap another peg. The disk drops there if the move is allowed.
- Move the tower. Rebuild the stack on the right-hand peg.
Rules
- Only one disk moves at a time.
- A disk can only go on an empty peg or a bigger disk.
Levels and difficulty
Three towers: 3, 4 and 5 disks.
Scoring
Each tower scores more with more disks, minus a penalty for moves beyond the minimum. Daily challenge scores can be shared with friends.
Tips and strategy for Tower of Hanoi
- The minimum number of moves is 2 to the power of the disk count, minus 1: 7, 15 and 31.
- Move the smallest disk every other turn, always in the same direction.
- With an odd number of disks, move the smallest disk to the target peg first.
History of the game
The puzzle was invented by French mathematician Édouard Lucas in 1883.
How we built and tested Tower of Hanoi
We solved every tower in the minimum number of moves in automated tests to confirm scoring and the gold medal logic.
Frequently asked questions
What is the minimum number of moves?
7 for 3 disks, 15 for 4 and 31 for 5.
Can I restart a tower?
Yes, use the Restart button.