Tower of Hanoi

Puzzle Games

Tower of Hanoi

Carry a whole stack across to the far peg, lifting a single disc per move and never big upon small.

Quick start

Tap a peg to lift its top disc, then tap another peg to put it down. A disc may only rest on a larger disc or an empty peg. Rebuild the full tower on the right-hand peg. The Min counter shows the fewest moves possible for that number of discs.

Controls: Tap or click

About this game

A puzzle shaped like a toy, with a lovely bit of mathematics hidden inside. A tower of discs sits on the left peg, largest at the bottom. Your job is to rebuild the tower on the right-hand peg, moving only the top disc of a peg each time and never letting a wide disc sit on a narrower one. The middle peg is your helper. Three discs can be solved in seven moves, and each disc you add more than doubles the minimum. Start with three and work your way up to eight. Free to play in your browser, with no download and no sign-up.

Game type
Puzzle Games
Last updated
Sep 18, 2026
Plays on
Phone, tablet and computer
Made by
MerryArcade (AdrawTech)

How this board works

You get three wooden pegs and a stack of coloured discs on the left one. Your job is to rebuild that exact stack on the right-hand peg. The middle peg is your helper, and a finished tower on the middle peg does not count, so keep your eye on the right.

Tap a peg to lift its top disc; the peg lights up with a purple outline so you know what you are holding. Tap another peg to drop it there. Changed your mind? Tap the same peg again and the disc goes back down with no move charged. If you try to set a disc on a smaller one, the game simply cancels the pick-up and reminds you that a disc can only rest on a bigger one.

The bar along the top shows three numbers: Discs (how tall your tower is), Moves (legal moves so far) and Min (the fewest moves the tower can be solved in). The circular arrow restarts the current tower from scratch. There is no undo, clock or hint.

Three discs, move by move

Letโ€™s walk the opening level together. Call the pegs Left, Middle and Right. The smallest disc is red, the middle one amber and the base yellow. Min reads 7, and here is how to hit it exactly:

  • Move 1: red from Left to Right.
  • Move 2: amber from Left to Middle.
  • Move 3: red from Right onto amber in the Middle.
  • Move 4: yellow from Left to Right. The big one is home.
  • Move 5: red from Middle back to Left.
  • Move 6: amber from Middle onto yellow on the Right.
  • Move 7: red from Left onto the top. Seven moves, a perfect solve.

Habits that quietly add moves

Most players finish three and four discs by feel, then hit a wall at five or six. The wall is usually one of these:

  • Sending the red disc the wrong way on move one. With an odd number of discs it goes straight to the Right peg; with an even number it goes to the Middle.
  • Moving the same disc twice in a row. In a perfect solution that never happens, so if you catch yourself doing it, you have just thrown a move away.
  • Shuffling the red disc back and forth between two pegs. It should travel around all three pegs in one steady direction.
  • Hunting for the big disc too early. The base disc only moves once, and it can only move when everything above it is stacked neatly on the helper peg.
  • Restarting at the first slip. Without an undo, a single wasted move often costs less than starting over, especially on tall towers.

Checkpoints for tall towers

On six, seven or eight discs it is easy to lose your place. The Moves counter becomes your best friend, because a perfect solve follows a rhythm you can check against it.

The halfway mark: the base disc moves exactly once, on the middle move of the whole solve. On five discs that is move 16 of 31; on eight discs it is move 128 of 255. So when your counter reads 127 on the eight-disc tower, the other seven discs should be sitting together on the middle peg. If they are not, you have drifted.

Every other move is red. On moves 1, 3, 5 and so on you move the smallest disc. On even moves there is only one legal move that leaves red alone. For an odd tower, red circles Left, Right, Middle, Left. For an even tower it circles Left, Middle, Right, Left.

Watch the colours. In a perfect solve a disc never lands directly on a disc of the same parity. Here that means red, yellow, blue and pink (discs 1, 3, 5 and 7) never sit straight on one another, and the same goes for amber, green, purple and cyan (2, 4, 6 and 8).

Climbing from three discs to eight

Each solve unlocks one more disc, starting at 3 and topping out at 8. The minimum doubles and adds one every step: 7, 15, 31, 63, 127 and finally 255. The finish screen tells you whether you matched it or how far over you went, so you can replay a level until it reads perfect.

After a six-disc win, tap Next: 7 discs and your new size is saved in this browser, so you can close the tab and pick up at seven tomorrow. Close the tab without tapping it and you come back to six. Beat the eight-disc tower and the button changes to Play again, which takes you back to a cosy three-disc warm-up.

A nice way to train: once you are comfortable, play the even-numbered towers in a row. Four, six and eight all begin with red going to the Middle, so the rhythm in your fingers carries straight across.

Where the puzzle comes from

The puzzle was published in 1883 by the French mathematician ร‰douard Lucas, who sold it under the playful pen name N. Claus de Siam, an anagram of Lucas dโ€™Amiens. It came with a tale of temple priests moving 64 golden discs, with the world due to end when they finished.

Moving 64 discs takes 2 to the power 64, minus 1, moves, which is over 18 quintillion. Even at one move a second that is hundreds of billions of years.

Family tips

Think of it recursively. To move a tower of five, you first move the top four out of the way to the spare peg, move the biggest disc, then move the four back on top. Each smaller tower follows the same idea.

The smallest disc moves on every other turn, always in the same direction around the pegs. When the disc count is odd it cycles left, right, middle; with an even number it goes the other way round. The move in between is the only legal move that doesnโ€™t touch the smallest disc.

If you lose track, look for the largest disc that isnโ€™t yet in its final place. Everything above it must end up on the spare peg, and that gives you your next goal.

Questions about Tower of Hanoi

What is the minimum number of moves for Tower of Hanoi?

It is 2 to the power of the number of discs, minus 1. On MerryArcade that means 7 for 3 discs, 15 for 4, 31 for 5, 63 for 6, 127 for 7 and 255 for 8. The Min number in the top bar always shows the target for your current tower.

Which peg should the first disc go to?

Count your discs. With an odd number (3, 5, 7), move the smallest disc straight to the right-hand peg. With an even number (4, 6, 8), move it to the middle peg first.

Is there an undo button?

No. This version has no undo, no hints and no timer. If you pick up the wrong disc you can tap the same peg to put it down for free, but a completed move stays on the counter. The restart arrow resets the current tower to zero moves.

Do I have to solve it in the minimum moves to reach the next level?

No. Any finished tower on the right-hand peg lets you tap through to the next size, up to 8 discs. The finish screen just tells you whether your solve was perfect or how many moves the minimum would have been.

Why didnโ€™t my tower count when I stacked it on the middle peg?

The goal here is the right-hand peg only. Carry a middle tower across to the right to finish.

Is there a simple trick to solve any size?

Yes. Move the smallest disc on every odd-numbered move, always circling it the same way round, and on the even moves make the only legal move that does not touch it. Follow that and you will solve any tower in the minimum.

If you liked Tower of Hanoi

More puzzle games โ†’