Tower of Hanoi Online

Move the full tower to the right peg. Place small disks on top of larger ones.

Moves 0Minimum 7

Move the full tower to the right peg.

How to Play Tower of Hanoi Online

Choose three, four, or five disks. The round starts with every disk on the left peg, ordered by size with the smallest on top. Your task is to move the full tower to the right peg. The middle peg holds disks temporarily while you make room for the largest ones.

To move, select a peg that contains at least one disk and then select a destination. The top disk is the only one you can move from its stack. You can place it on an empty peg or on a larger disk. If you try to place a larger disk on a smaller one, the game leaves both stacks in place so you can pick another destination. Choose the source again to clear your selection.

Use a mouse, tap the two pegs one after the other, or navigate the peg buttons with Tab and activate them with Enter or Space. Each peg announces how many disks it holds and the size of its top disk. The Moves counter advances after a legal move. Undo reverses the last move and restores the previous count.

Move a Smaller Tower First

To move the largest disk to the right peg, both the left and right pegs need space for it. First move the stack above the largest disk to the middle peg. Then move the largest disk to the right. Finally, move the smaller stack from the middle peg onto the largest disk. Each phase has the same rules, but the pegs take different roles.

On the three-disk Tower of Hanoi, start by moving the smallest disk to the right peg. Move the second disk to the middle, then put the smallest disk on top of it. The largest disk can now go straight to the right. The other two disks are on the middle peg, ready for you to move them onto the largest disk by using the left peg as temporary space.

When you get stuck, ask which disk needs to move next and which peg it must reach. Then work backward to see what is in the way. The peg you intend to use as temporary space may already hold a small disk. Clearing it can make the next plan easier to see. Use Undo to revisit the last decision without resetting the board.

Compare Your Moves With the Minimum

The minimum moves in Tower of Hanoi are 7 for three disks, 15 for four, and 31 for five. In a shortest solution, each extra disk requires moving the smaller tower twice plus one move for the new largest disk. That is why the minimum more than doubles when you add a disk. The counter above the board lets you compare your current round with that target.

On the five-disk Hanoi puzzle, try to finish the first four-disk transfer before thinking about the final stack. Once the largest disk is on the right peg, you can solve the remaining four-disk transfer with the same method. The order of the pegs will feel different, so name them by role each time. Identify the source, destination, and spare peg for the group you are moving.

The game accepts any legal solution. You can make extra moves, undo them, or restart. Switch disk counts for a different challenge and try to improve one stage of your play before aiming for the full minimum.

Choose Another Strategy Puzzle

If you enjoy planning a sequence of moves, Peg Solitaire Online asks you to move pieces while leaving routes open for later jumps. The sliding puzzle online lets you practice shifting tiles with one open space. Browse the puzzle game library or return to the online puzzle games homepage to pick your next challenge.

Frequently asked questions

How do you play Tower of Hanoi Online?

Select a source peg and a destination. Move one top disk at a time until the full tower is on the right peg.

Can you put a large disk on a smaller disk?

A moved disk can land on an empty peg or on a larger top disk. The game keeps the stacks in place if a move breaks that rule.

What is the minimum number of moves?

The minimum is 7 moves for three disks, 15 for four, and 31 for five.

Can I undo a move or start over?

Undo reverses the latest move and reduces the move count. Restart returns every disk to the left peg.

Can I solve the puzzle on my phone?

Yes. Tap the source peg and then the destination peg. Keyboard and mouse controls are available as well.

Comments