Tower of Hanoi is the famous puzzle of three pegs and a stack of rings. All the rings start on the left peg, biggest at the bottom, and your goal is to rebuild the same stack on the right peg. This version shows your move count next to the best possible score and can play out the perfect answer for you.
How Tower of Hanoi Works
Only one ring moves at a time. You lift the top ring from a peg and drop it on another. A ring may land on an empty peg or on a bigger ring, never on a smaller one. While you hold a ring, it floats over the selected peg so you can see where it will go.
You start with three rings. The plus and minus icons change the stack size, and any change starts a fresh puzzle. Each drop adds one to the move counter, even if you put the ring back where it came from.
The counter reads like 9/7, meaning moves made over the minimum. That minimum is always one less than two raised to the number of rings.
Your First Few Minutes
- Look at the counter and note the target, which is 7 for three rings.
- Click the left peg to lift the smallest ring and drop it on the right peg.
- Move the middle ring to the center peg, then put the small ring on top of it.
- Shift the largest ring to the right peg and rebuild the rest over it.
- Press the play icon to watch the solver, then add a ring and try again.
Controls for Tower of Hanoi
| To do this | Keyboard | Mouse | Touch screen |
|---|---|---|---|
| Pick up or drop a ring | Space, Enter, Up/Down arrows, or W/S | Click a peg | Tap a peg |
| Move the selection between pegs | Left/Right arrows or A/D | not used | not used |
| Restart the puzzle | R | Click the circular arrows icon | Tap the circular arrows icon |
| Add or remove a ring | not used | Click the plus or minus icon | Tap the plus or minus icon |
| Watch the puzzle solve itself | not used | Click the play icon (click again to stop) | Tap the play icon (tap again to stop) |
What It Trains
Tower of Hanoi rewards planning in layers. To move a big ring, you first clear every smaller ring onto a spare peg, which is a smaller copy of the same puzzle. You also start to notice the repeating rhythm and the doubling pattern in the minimum move counts.
Strategy Notes
- Check odd or even. With an odd ring count, the smallest ring first goes right. With an even count, it goes to the middle.
- Alternate with the small ring. Every other move in a perfect run uses it, always circling the same way.
- Take the only other move. Between small ring moves, just one legal move exists.
- Break the stack down. Move all but the bottom ring aside, shift the bottom one, then rebuild.
- Study the solver once. Four or five rings show the pattern clearly.
Good to Know
It works with a keyboard, mouse or touch, and the controls sit in the bottom corner on phones. Douile made the game and this site added click and tap controls and a restart button.















