Tower of Hanoi

Move the tower from the first peg to the third, one disc at a time, never a bigger disc on a smaller one. 3 to 8 discs, and an owl who knows the fewest moves.

How to play Tower of Hanoi

Tower of Hanoi is the classic disc puzzle on a velvet tray: three needles, and a tower of gold discs, biggest at the bottom, standing on the first. You can play towers of 3 to 8 discs, and an owl beside the tray knows the fewest moves for each.

The goal

Move the whole tower from the first needle to the third. A tower of n discs takes at least 2 to the power n, minus 1, moves. The header shows the moves you have made and how many are left from where you stand at the fewest.

DiscsFewest moves
37
415
531
663
7127
8255

The rules

  • Move one disc at a time, and only the top disc of a needle.
  • Never put a bigger disc on a smaller one. A needle that cannot take the disc leaves it in your hand.
  • The tower is done when every disc stands on the third needle.

Controls

  • Tap a needle to lift its top disc, then tap another needle to put it down. Tap the same needle again to put the disc back.
  • On a computer, press 1, 2 or 3 to pick up the top disc of that needle, then a second number to put it down. Z takes back your last move and Escape puts the disc back.
  • Take back, at the foot of the screen, undoes your last move as often as you like.
Tower of Hanoi with three discs on a black velvet tray: gold and rose-gold discs graded by size, the two bigger on the first of three crystal needles and the smallest already moved to the third. The header reads 1 move, 6 to go, and an owl panel beside the tray gives the next step.

The owl

The owl speaks after every move: it names the next step on the shortest way. Ask the owl, at the foot of the screen, gets one answer when you want it. In Settings, The owl after every move turns the running advice off, and the owl then speaks only when asked.

When a tower is solved

The discs light, a stave shows your solve move by move, and the owl names the detours you made. Again plays the same size; the next size up follows it. A solve in the fewest possible moves is marked with a spark on the size's rung.

Sizes and settings

  • Home shows a ladder of sizes from 3 to 8 discs. A size you have solved carries a gold bar, and the fewest moves you have solved it in is kept.
  • A tower you leave unfinished waits on Home as Continue, at the move where you stopped.
  • The gear, top right, opens Settings: the size of the next tower, a new tower, Home, the owl, sound, and a link to the site's sound and music settings. Sound is off until you turn it on.

Coins

A solved tower pays 10 coins, once for each tower. Replaying the same tower after a take-back pays nothing more.

Your fewest moves per size, your last settings and the tower in progress are kept on your device.