Play Tower of Hanoi Online Free

Rebuild a stack of rings on the right peg, one ring at a time, without ever putting a larger ring on a smaller one.

Tower of Hanoi title screen on SZ Games
  • Touch ready

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

Input guide for Tower of Hanoi
To do thisOn a keyboardWith a mouseOn a touchscreen
Lift or set down a ringSpace, Enter, Up/Down arrows, or W/SClick on a pegTap on a peg
Shift the selection to another pegLeft/Right arrows or A/D——
Reset the puzzlePress RClick the circular arrows iconTap the circular arrows icon
Change the number of rings—Click the plus or minus iconTap 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:

Tower of Hanoi – Questions and Answers

What is the smallest number of moves?

The counter shows it next to your own move count. Three rings need seven moves, and each extra ring roughly doubles the total.

Can I add more rings?

Yes. The plus icon adds a ring and the minus icon removes one, down to three. Changing the count starts a fresh puzzle.

Can the game show me the answer?

Yes. A built-in solver plays out the perfect sequence at a steady pace. It is a good way to see the pattern before trying a bigger stack yourself.

Try Something Different