Tower of Hanoi Unblocked

Rebuild a tower of rings on the far peg, moving one at a time and never stacking a larger ring on a smaller one.

Tower of Hanoi is a famous logic puzzle shown here on a plain black background. There are three pegs in a row. A stack of rings sits on the left peg, biggest at the bottom and smallest on top. You need to move the whole stack over to the right peg.

This version by Douile counts your moves against the smallest possible total, lets you add more rings and can even play out the perfect answer while you watch.

The rules

Only one ring moves at a time. You lift the top ring off any peg and put it on another. A ring may go onto an empty peg or onto a larger ring, but never onto a smaller one. A lifted ring floats over whichever peg is currently selected, letting you see where it will land before you let go.

Every drop counts as a move, even if you put the ring back where it came from. Think before you lift.

How progress is shown

Your first puzzle uses three rings, and the best possible solve is seven moves. In the top right, a counter like 9/7 shows the moves you have made against the best possible. When the last ring reaches the right peg, the board zooms in and out briefly to mark the finish.

The small icons in the corner let you restart, add or remove rings, and start the auto-solver. R on the keyboard restarts too.

Strategy notes

  • Check whether the ring count is odd or even before you start. With an odd count, the smallest ring’s first move is to the right peg. With an even count, it goes to the middle.
  • In a perfect solve, the smallest ring moves on every other turn, and it always cycles around the pegs in the same direction.
  • On the turns between, only one other legal move exists, so take it.
  • Break big stacks into smaller ones. To move five rings, first shift the upper four to the middle peg as a group, then move the biggest ring across, and finally carry those four over onto it.

Why it’s worth a try

The puzzle is easy to learn and deeper than it looks. Once you spot the repeating rhythm, you can solve stacks of any height without a mistake, and matching the minimum number of moves is a satisfying goal. Running the solver once on four or five rings is a great way to see that rhythm clearly. It also makes a quick brain break on a school laptop, since a three-ring stack needs only seven moves.

Controls

ActionKeyboardMouseTouch
Pick up or drop a ringSpace, Enter, Up/Down arrows, or W/SClick a pegTap a peg
Move the selection between pegsLeft/Right arrows or A/D——
Restart the puzzleRClick the circular arrows iconTap the circular arrows icon
Add or remove a ring—Click the plus or minus iconTap the plus or minus icon
Watch the puzzle solve itself—Click the play icon (click again to stop)Tap the play icon (tap again to stop)

Tower of Hanoi FAQ

How many moves does a perfect solve take?

It is always two raised to the number of rings, minus one. Three rings take 7 moves, four take 15 and five take 31. The counter at the top shows your moves next to that best total.

Can I play Tower of Hanoi on a phone or Chromebook?

Yes. Choose a peg to pick up whichever ring is on top, then choose a second peg to set it down. Keyboard play works too, with the arrow keys or A and D to choose a peg and Space or Enter to lift and drop.

Is there a way to see the solution?

Yes. The play icon runs a built-in solver that shows the perfect sequence at a steady pace. A second press halts it, though restarting it begins the whole sequence over, so it is best for studying the pattern rather than finishing your game.

How do I make the puzzle harder?

Use the plus icon to add rings. Each extra ring roughly doubles the number of moves needed. The minus icon takes rings away, down to three. Changing the count always starts a fresh puzzle.

More games like Tower of Hanoi

All puzzle games →