Click to move
No dragging required — click a source peg then a destination peg to move the top disk.
Move the whole stack from the first peg to the last, one disk at a time, without ever placing a larger disk on a smaller one.
Click a peg to pick up its top disk, then click another peg to move it.
No dragging required — click a source peg then a destination peg to move the top disk.
Your move count is shown right next to the mathematically optimal number of moves.
Auto-solve animates the shortest solution end to end whenever you want to see it in action.
All disks start stacked in order of size on the first peg. The goal is to rebuild that exact stack on the last peg.
Tower of Hanoi is a classic recursive puzzle often used to teach problem decomposition: to move n disks, you first move the top n-1 disks out of the way, move the largest disk, then move the n-1 disks back on top of it. That recursive structure is exactly why the minimum move count grows so quickly as disks are added.
Each extra disk roughly doubles the minimum number of moves required, from 7 moves at 3 disks to 255 moves at 8 disks.
The optimal solution is defined recursively: solve for one fewer disk, move the biggest disk, then solve for one fewer disk again.
A disk can never be placed on top of a smaller one — every other move is fair game.
Because early moves constrain later ones, thinking several moves ahead pays off far more than moving disks at random.
Common questions about the rules, move counts and auto-solve.
Move the entire stack of disks from the first peg to the last peg, moving only one disk at a time and never placing a larger disk on top of a smaller one.
The optimal number of moves for n disks is 2 to the power of n, minus 1. For example, 3 disks need 7 moves and 8 disks need 255 moves.
Click the peg holding the disk you want to move, then click the peg you want to move it to. An illegal move, like placing a larger disk on a smaller one, is simply ignored.
Auto-solve animates the shortest possible solution move by move so you can watch the optimal strategy play out, then you can try to match it yourself.
Yes. Choose anywhere from 3 to 8 disks before starting, which changes both the difficulty and the optimal move count.