Puzzles & Logic

Tower of Hanoi

Move the whole stack to another peg, one disk at a time, never a larger disk on a smaller one. A free Tower of Hanoi puzzle that quietly trains planning — play it right here.

⚡ Quick answer

The Tower of Hanoi is a puzzle where you move a stack of disks from one peg to another, one at a time, never putting a larger disk on a smaller one. The minimum number of moves is 2ⁿ−1, so three disks take 7 moves, four take 15, and five take 31. It mainly exercises planning and sequencing — thinking a few steps ahead — rather than memory. The honest score is your move count versus the optimal, and versus your own past.

Key takeaways

  • Move the whole stack to another peg, one disk at a time, never larger on smaller.
  • The fewest possible moves is 2ⁿ−1: 7 for three disks, 15 for four, 31 for five.
  • Trains forward planning and sequencing — thinking several steps ahead — not memory.
  • Score your moves against the optimal and against your own past, not a ranking.

The Tower of Hanoi is one of the oldest puzzles in the book: a stack of disks on one peg, and the simple-sounding goal of rebuilding it on another — moving one disk at a time and never placing a bigger disk on a smaller one. It looks easy with three disks and gets satisfyingly tangly with five.

Play it above (tap a peg to lift its top disk, then tap where to drop it), then read on for the trick to solving it and what it actually exercises.

How to play

  • Pick 3, 4, or 5 disks. Tap a peg to lift its top disk — it highlights.
  • Tap another peg to drop the disk there. You can only drop onto an empty peg or a larger disk.
  • Move the entire stack to a different peg to win.
  • Your move count is shown against the fewest possible (2ⁿ−1); your best per disk count is saved on your device.

It all runs in your browser — no sign-up, nothing sent anywhere.

The trick to solving it

There's a clean recursive idea behind it: to move a stack of n disks to the target peg, first move the top n−1 disks to the spare peg, move the biggest disk to the target, then move those n−1 disks on top. Each size repeats the same plan.

A simple hands-on rule also works: always move the smallest disk every other turn, and always in the same direction (for example, rightward, wrapping around); on the in-between turns, make the only other legal move. Follow that and you'll solve it in the optimal number of moves.

What it trains

Tower of Hanoi is a classic test of planning and problem-solving:

  • Forward planning — holding a multi-step plan in mind before you act.
  • Sequencing — ordering sub-goals so they don't undo each other.
  • Working memory — keeping track of where you are in the plan.
  • Patience and error-checking — noticing when a move leads to a dead end.

Like any single puzzle, it mostly makes you better at itself and similar planning tasks — it's an enjoyable workout, not a proven way to raise general intelligence.

The honest way to read your score

Two fair comparisons: your moves versus the optimal (2ⁿ−1), and your own time across attempts. Solving five disks in 31 moves is a perfect game — chasing that is far more meaningful than any made-up ranking.

If you like planning puzzles, sudoku is a different flavour of the same logic muscle, and you can browse more in our memory games guide. For a self-relative check you can repeat, try the memory test online.

⚠ When to talk to a professional

This is a non-medical puzzle game for fun and practice, not a test of intelligence or brain health. Puzzle performance varies with practice and familiarity. If you're worried about a real, persistent change in your thinking or memory, speak with a qualified healthcare professional rather than reading anything into a game score.

Frequently asked questions

What is the minimum number of moves in Tower of Hanoi?
For n disks the minimum is 2ⁿ−1 moves: 7 for three disks, 15 for four, and 31 for five. The game shows this target so you can see how close to perfect your solution is.
Is the Tower of Hanoi good for your brain?
It's an enjoyable workout for planning and sequencing — thinking several steps ahead. Like any single puzzle it mainly improves the skill it uses, so treat it as fun practice rather than a guaranteed brain booster.
Is the Tower of Hanoi game free?
Yes — it plays entirely in your browser with no sign-up or download, and your best move count is saved only on your own device.

Build a daily brain habit

Take a short, non-medical quiz and get a simple daily routine — about ten minutes a day of memory, focus, and puzzles.

Try the free memory test