Omni Brain

Play in your browser · Logic

Tower of Hanoi

Move the whole tower to the third peg, one disc at a time, never putting a bigger disc on a smaller one. Choose 3 to 6 discs and see how close you come to the minimum number of moves.

This puzzle runs in your browser with JavaScript. Turn it on to play, or get Omni Brain for the full version.

How to play

  1. Choose 3 to 6 discs above the board. The tower starts on peg 1, and the goal is peg 3.
  2. Tap or click a peg to lift its top disc, then tap the peg where it should go. Keys 1, 2 and 3 do the same.
  3. A bigger disc can never sit on a smaller one. When the whole tower is on peg 3, you see your moves next to the minimum, and your time.

What your score means

With n discs the puzzle needs at least 2ⁿ − 1 moves: 7 for three discs, 15 for four, 31 for five and 63 for six. That is a mathematical fact, so a result equal to the minimum is a perfect solve, and every move above it is a detour.

Your best result is the biggest tower you have solved in the minimum number of moves. For each disc count the game also keeps your fastest time in this browser, so you can work towards both: first a perfect solve, then a quicker one.

About the Tower of Hanoi

The Tower of Hanoi is a puzzle published by the French mathematician Édouard Lucas in 1883. Three pegs hold a stack of discs of different sizes, and the task is to move the whole stack to another peg, one disc at a time, without ever placing a bigger disc on a smaller one. The puzzle has a neat recursive solution: to move the largest disc, every smaller disc first has to sit on the spare peg, and that smaller tower is moved in the same way. That is why the minimum number of moves doubles with each extra disc, plus one. Solving it well takes planning several steps ahead, holding sub-goals in working memory and checking each move against the rule, and psychologists use tower tasks of this kind to study planning. In Omni Brain the same idea runs as Tower, with difficulty that adapts to you and later levels with a move limit.

B Core process · The Tower of Hanoi is a standard planning test. Practice improves the strategy inside the task; the “plan the sub-goal” habit is what carries over.

Techniques from the app

  • Free the biggest disc. To move the largest disc, everything smaller must sit on the spare peg. Make that the goal, then repeat one disc down.
  • Smallest disc, same direction. Move the smallest disc every second move, always in the same direction around the pegs. The other move is then forced.

Train planning every day in Omni Brain

Tower and many more short games, each with a technique you can use outside the app. Free every day.

Questions about the Tower of Hanoi

What is the minimum number of moves for the Tower of Hanoi?

For n discs it is 2ⁿ − 1: 7 moves for three discs, 15 for four, 31 for five and 63 for six. Each extra disc doubles the count and adds one.

How do you solve the Tower of Hanoi?

Think in sub-goals. To put the biggest disc on the goal peg, first move all the smaller discs to the spare peg, then move the biggest disc, then move the smaller tower on top of it in the same way. Another route to the same solution: move the smallest disc every second move, always in the same direction around the pegs; the move in between is then forced.

Does lifting a disc count as a move?

No. A move counts when a disc lands on a different peg. If you lift a disc and put it back on the same peg, nothing is added.

What does the Tower of Hanoi train?

It is a planning task: you set a sub-goal, keep it in mind and check every move against the rule. Practice makes you better at the puzzle itself; the habit of planning the sub-goal before acting is the part that carries over, which is why the game carries a B evidence label.

Omni BrainFree every day Get the app