Skip to main content
PlayMemorize

Tower of Hanoi

Move all disks from the first peg to the third using the minimum number of moves. Classic recursive puzzle, 3 to 7 disks

Move all disks from the first peg to the third using the minimum number of moves. Classic recursive puzzle, 3 to 7 disks

About Tower of Hanoi

The Tower of Hanoi is one of the most elegant mathematical puzzles ever devised. You start with a stack of disks arranged by size on the leftmost peg, largest at the bottom. The goal: move the entire stack to the rightmost peg, one disk at a time, never placing a larger disk on top of a smaller one.

Why it trains your brain. The optimal solution for n disks requires exactly 2n - 1 moves, a fact that emerges naturally once you play enough. The puzzle forces recursive thinking: to move n disks to the right peg, you first move n-1 disks to the middle, move the bottom disk to the right, then move the n-1 stack on top. Players who internalize this pattern can solve it flawlessly every time.

Difficulty scales naturally. PlayMemorize starts you at 3 disks (7 moves minimum) and ramps up to 7 disks (127 moves minimum). A move budget above the optimal is given; the challenge tightens as your labyrinth level rises.

Part of the PlayMemorize family of brain-training games. Runs entirely in your browser, works offline as a Progressive Web App.

How to master

New game videos on YouTube

FAQ

  • What is the minimum number of moves?

    For n disks the minimum is exactly 2^n - 1 moves: 3 disks = 7 moves, 4 disks = 15, 5 disks = 31, 6 disks = 63, 7 disks = 127. PlayMemorize gives you a small budget above this minimum so beginners can still win while learning the pattern.
  • How do I always find the optimal solution?

    The recursive trick: to move n disks from A to C using B, first move n-1 disks from A to B, then move disk n from A to C, then move n-1 disks from B to C. Repeat this rule at every step and you will always reach the minimum move count.
  • What happens if I run out of moves?

    The round ends and is counted as a loss. You get to try again with a fresh puzzle. In the labyrinth, exhausting the move budget drops you back one level.
  • Can I print Tower of Hanoi as a worksheet?

    Yes. The worksheet version shows a sequence of peg-state diagrams and asks students to fill in the correct next move. Build a sheet from the master generator at /worksheets.
  • Does it work offline?

    Yes. PlayMemorize is a Progressive Web App. Install once and Tower of Hanoi plays anywhere without an internet connection.
  • Can MemPi help me study and practice this game?

    Yes! Click MemPi in the header or on the game board to summon him. He observes the board, thinks out loud, and can demonstrate moves or guide you through tricky steps.

New game videos on YouTube We make a short video for each game. Subscribe to see the new ones.

OK