Tower of Hanoi Unblocked

Play Tower of Hanoi online for free in your browser. No download, no sign-up.

Tower of Hanoi gameplay screenshot
  • Works on mobile
Report a problem

Tower of Hanoi is the classic peg-and-ring puzzle drawn on a simple black canvas. Three pegs stand side by side, and a stack of rings starts on the left one, largest at the bottom. Your job is to rebuild the stack on the right-hand peg. This version by Douile shows your move count next to the smallest possible total, lets you raise the number of rings, and can play out the perfect solution for you to watch.

How to Play Tower of Hanoi

You move one ring at a time. Lift the top ring from any peg, carry it over another peg, and set it down. A ring can only land on an empty peg or on a ring that is larger than itself. The held ring floats above the peg you have selected, so you always see where it will go.

The game starts with three rings, which can be solved in seven moves. The plus icon adds a ring and the minus icon removes one, down to a minimum of three. Changing the count starts a fresh puzzle.

The counter at the top right reads moves made over the best possible total, such as 9/7. When the last ring lands on the right peg, the board briefly zooms in and back out to mark the finish. Try to match the minimum, then add another ring.

Tower of Hanoi Controls

Controls for Tower of Hanoi
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)

Tips and Strategies

  • Count the rings first. With an odd number of rings, the smallest ring’s first move goes to the right peg. With an even number, it goes to the middle peg.
  • Move the smallest ring every other turn. Every second move in a perfect solution is the smallest ring, and it always travels around the pegs in the same direction.
  • Between those turns, there is only one legal move. When the smallest ring stays put, exactly one other move is allowed, so take it.
  • Think in sub-stacks. To move five rings, first park the top four on the middle peg, shift the big ring, then rebuild the four on top of it.
  • Watch the solver once. Running the auto-solve on four or five rings makes the repeating rhythm easy to see.

Features

  • Live move counter: your moves are shown beside the minimum for the current stack.
  • Adjustable size: add rings for a longer challenge or drop back to three.
  • Built-in solver: watch the optimal sequence play out at a steady pace.
  • Keyboard or pointer: use the arrow keys and Space, or simply click and tap the pegs.

Tested and updated:

Tower of Hanoi Unblocked: FAQ

What is the fewest number of moves for each stack?

The counter in the top corner shows it after the slash. It is always one less than two raised to the number of rings, so 3 rings need 7 moves, 4 need 15 and 5 need 31.

Does picking up a ring and putting it back count as a move?

Yes. Every time you drop a ring, the counter goes up by one, even if it lands on the same peg it came from. Plan each lift before you make it.

Can I pause the automatic solver and finish the job myself?

Not really. Pressing the play icon again stops it, but the next run starts over from the beginning. Use it to study the pattern, then reset and try it on your own.

How does it work on a phone?

Tap a peg to lift its top ring and tap another peg to set it down. The four small icons in the bottom corner handle restart, auto-solve and ring count.

More Free Games to Play Online