About Tower of Hanoi
Tower of Hanoi is a classic puzzle with three pegs and a stack of disks of different sizes. The disks start piled on one peg from largest at the bottom to smallest on top, and your goal is to move the whole tower to another peg, one disk at a time, without ever putting a bigger disk on a smaller one.
It was invented by the French mathematician Edouard Lucas in 1883, and it hides a neat piece of math: solving it with the fewest moves always takes exactly two to the power of the number of disks, minus one. That means three disks take seven moves, but eight disks take 255, so the puzzle grows fast.
You can play Tower of Hanoi free in your browser with no download. Three disks make a gentle warm-up you can solve in a minute, while the larger towers are a real commitment. Because the solution follows a clean pattern, it is a satisfying puzzle to master, and each level nudges you toward the elegant, minimal path.
Controls
You play by moving disks between the three pegs. Click a peg (or tap it on a phone) to lift its top disk, then click or tap another peg to drop the disk there. There's no dragging on either device. Only the top disk of any peg can be moved.
One rule defines the entire puzzle:
- Moving a disk takes the top disk from one peg and places it on another. You can only ever move one disk at a time.
- The size rule forbids placing a larger disk onto a smaller one. This single restriction is what makes the puzzle a puzzle.
You solve it by rebuilding the entire tower, in order, on a different peg. Undo reverses your last move if you tap the wrong peg.
The number of disks rises across eight levels, and each level has a known minimum number of moves worth aiming for.
Tips
- Start by thinking about the smallest disk. The tiny disk moves most often, and its moves follow a steady rhythm, so getting a feel for where it goes next carries much of the solution.
- Move the smallest disk the same direction each time. Always shifting the smallest disk in one consistent direction, then making the only other legal move, produces the perfect solution automatically.
- Break the puzzle into smaller towers. To move a big stack, you first move the stack above it out of the way. Seeing the problem as 'move the smaller tower, then the big disk, then the tower back' makes any size manageable.
- Never undo your last move. Immediately moving a disk back where it came from wastes two moves and gets you nowhere, so if a move feels pointless, it usually is.
- Aim for the minimum move count. Each level has an exact fewest-moves target, and trying to hit it forces you to find the clean pattern instead of shuffling disks around randomly.
- Stay patient on the big towers. The larger puzzles take hundreds of moves, so trust the pattern and keep the rhythm steady rather than trying to rush toward the finish.
Frequently asked questions
Is Tower of Hanoi free to play?
Yes. You can play as much as you want with no download and no account.
How do you play Tower of Hanoi?
You move a stack of different-sized disks from one peg to another, one disk at a time. The only rule is that you can never place a larger disk on top of a smaller one.
How do you solve it?
You rebuild the full tower on a different peg. A reliable method is to move the smallest disk in a consistent direction every other turn and make the only other legal move in between, which produces the shortest solution.
What is the fewest moves needed?
The minimum is two to the power of the number of disks, minus one. So three disks take seven moves, four take fifteen, and the count roughly doubles with each disk you add.
Can I play Tower of Hanoi on my phone?
Yes. It runs in any modern mobile browser. You tap one peg to lift its disk and tap another to drop it, no dragging needed, so it works well on phones and tablets.
How do I get better at Tower of Hanoi?
Learn the pattern of moving the smallest disk in one direction, and practice breaking a big tower into smaller ones. Once the rhythm clicks, even the large towers become straightforward.