Tower of Hanoi is a famous logic puzzle built from three pegs and a pile of rings. The rings start on the left peg, biggest at the bottom, and you have to rebuild the same stack on the right peg. Play Tower of Hanoi unblocked in your browser and you will soon meet the one rule that makes it tricky: a larger ring can never sit on a smaller one. This version by Douile draws everything on a plain black canvas, compares your moves with the best possible score, and can even solve itself while you watch.
How to Play Tower of Hanoi
There are only two rules:
- Each move shifts a single ring, and it has to be the topmost one on its peg.
- A ring can rest on a bare peg or on a bigger ring, but never on a smaller one.
You win when every ring sits on the right peg in the original order. If you try to drop a ring on a smaller one, nothing happens and the ring stays in your hand, so you cannot break the rule by accident. Find a legal peg and drop it there.
The rings are colored from bright green for the smallest to yellow for the largest, so you can judge sizes at a glance. The ring you are about to lift has a red outline. Once you lift it, it floats in green above the chosen peg so you always know where it will land.
Your First Solve With Three Rings
A new game starts with three rings. Here is the perfect seven-move solution, using left, middle and right for the pegs:
- Small ring to the right.
- Middle ring to the middle peg.
- Small ring onto the middle peg.
- Big ring to the right. The hardest part is done.
- Small ring back to the left.
- Middle ring onto the big ring on the right.
- Small ring to the right.
Try it once by following the list, then do it again from memory. When the stack lands, the board does a quick zoom, and the counter shows 7/7.
Moves, Rings and the Counter
The counter in the top-right corner looks like a fraction, such as 9/7. The first number is how many moves you have made and the second is the minimum possible. Every drop counts, even setting a ring back where it came from.
Use the plus icon in the bottom corner for a taller stack, or the minus icon for a shorter one. Three is the lowest you can go, and there is no hard top limit, so you can keep adding rings as long as you like. Each change, like the restart icon or the R key, sets up a fresh puzzle.
The minimum grows fast, because each extra ring roughly doubles it:
- 3 rings: 7 moves
- 4 rings: 15 moves
- 5 rings: 31 moves
- 6 rings: 63 moves
- 7 rings: 127 moves
- 10 rings: 1,023 moves
Tower of Hanoi Strategy and Pattern
The puzzle has a neat rhythm once you see it:
- Odd or even decides move one. If the ring count is odd, the smallest ring goes to the right peg first. If it is even, send it to the middle peg instead.
- The smallest ring moves every other turn. It always travels around the three pegs in the same direction.
- The turn in between has only one choice. When the small ring rests, exactly one other legal move exists that does not involve it, so make that move.
- Think in smaller stacks. Moving five rings really means moving the top four out of the way, then the biggest ring, then those four again on top of it.
- Aim for the biggest ring. Your real goal is to clear a path for the bottom ring to reach the right peg in one move. Everything before that is setup.
Mistakes New Players Make
The most common one is starting the small ring on the wrong peg. With an even number of rings, sending it right first makes the perfect score impossible. If your count is already above the minimum early on, press R and start over.
Another is lifting a ring and then putting it back. That costs a move and gets you nothing. Plan the next two or three moves before you touch anything. Last, many players jump from three rings straight to six. Work up one ring at a time so the pattern sticks.
Learning From the Auto-Solver
The play icon runs the perfect solution at about ten moves per second. Try it with four or five rings and watch how the smallest ring loops around. Press the icon again to pause the solver mid-way, then finish the puzzle yourself from that position. Pressing play again restarts the solution from a fresh stack.
Seven rings take the solver just under 13 seconds. It is a good way to see why the minimum doubles, since each larger stack is two copies of the smaller solve joined by one big move.
Playing on a Chromebook or Phone
On a keyboard, use the left and right arrows or A and D to choose a peg, and Space, Enter, the Up or Down arrow, W or S to lift and drop. When you are not holding a ring, the selection skips empty pegs. With a mouse or a touch screen, click or tap a peg to lift its top ring, then tap another peg to drop it.
The canvas resizes to fit the window, so it works on a Chromebook and on phones in either direction. Landscape gives the rings more width when the stack gets tall. There is no sound and nothing to install.
Similar Puzzles on Totally Science
Tower of Hanoi is a short brain workout that suits a five-minute break, or a longer session if you chase a perfect seven-ring solve. If you like it, try 15 Puzzle, which also rewards planning ahead, but with sliding tiles. Light Flip is another pattern puzzle where each move changes several things at once. For number logic, Number Trail is a good next step. Browse more on the puzzle games page.





