Tower of Hanoi is a classic puzzle with three pegs and a stack of rings. The rings start on the left peg, biggest at the bottom. You must rebuild the whole stack on the right peg. This version by Douile uses a plain black canvas, counts your moves against the best possible total and can solve the puzzle for you.
The Only Two Rules
You move one ring at a time, and only the top ring of a peg can move. A ring may land on an empty peg or on a larger ring, never on a smaller one. That is all, yet the number of moves grows fast as you add rings.
Making a Move
Pick up the top ring of a peg, then choose the peg where it should go. The held ring floats above your chosen peg so you can see where it will land before you drop it. You can use the arrow keys and Space, or simply click or tap the pegs.
How to Control Tower of Hanoi
| To do this | On a keyboard | With a mouse | On a touchscreen |
|---|---|---|---|
| Lift or set down a ring | Space, Enter, Up/Down arrows, or W/S | Click on a peg | Tap on a peg |
| Shift the selection to another peg | Left/Right arrows or A/D | — | — |
| Reset the puzzle | Press R | Click the circular arrows icon | Tap the circular arrows icon |
| Change the number of rings | — | Click the plus or minus icon | Tap the plus or minus icon |
| Let the puzzle solve itself | — | Click the play icon (click once more to stop) | Tap the play icon (tap once more to stop) |
The counter in the top right shows moves made over the minimum, for example 9/7. When the stack is complete on the right peg, the view zooms in and back out to mark your win.
Growing the Challenge
You start with three rings. The plus icon adds one more, and the minus icon takes one away, down to three. Each new size starts a new puzzle. Try to match the minimum, then step up.
Patterns That Help
- With an odd number of rings, move the smallest ring to the right peg first. With an even number, start with the middle peg.
- In a perfect solution, the smallest ring moves on every other turn, always in the same circular direction.
- On the turns in between, only one other move is legal, so make it.
- Think of the stack in parts. To move five rings, move the top four aside, move the biggest, then bring the four back on top.
- Watch the solver once on four or five rings to see the rhythm.
Who It Is For
The puzzle is great for students learning about recursion and for anyone who likes clean logic. For more classic brain teasers, try Peg Solitaire, or look through the puzzle games.
Last played and checked by SZ Games:













