Last updated: March 29, 2026
Move all disks from the left peg to the right peg. Only one disk at a time, and never place a larger disk on a smaller one. Choose 3 to 10 disks.
Loading game...
French mathematician Edouard Lucas introduced the Tower of Hanoi in 1883 as a mathematical puzzle wrapped in a legend about monks moving 64 golden disks. According to the story, the monks must transfer the disks between three pegs following strict rules, and when they finish, the world ends. At one move per second, solving 64 disks takes roughly 585 billion years. The puzzle challenges you to move a stack of disks from one peg to another, moving one disk at a time and never placing a larger disk on a smaller one. The minimum number of moves follows the formula 2^n - 1, where n is the number of disks. Three disks take 7 moves. Eight disks take 255. Play our browser version right now and see how close you can get to the optimal count.
You start with disks 3, 2, and 1 stacked on peg A. Move disk 1 to peg C, disk 2 to peg B, disk 1 to peg B, disk 3 to peg C, disk 1 to peg A, disk 2 to peg C, and finally disk 1 to peg C. Seven moves total, which is the optimal count for 3 disks.
You have 5 disks in play. Disks 1 and 2 sit on peg B, and disk 3 needs to reach peg C. You realize peg B holds the smaller disks exactly where they need to be. Move disk 1 to peg A, freeing disk 2 to move to peg C, then move disk 1 to peg C on top of disk 2.
You switch to 6 disks and feel overwhelmed. You press Auto-Solve and watch the recursive algorithm work. It moves the top 5 disks to peg B, slides disk 6 to peg C, then moves the 5 disks from peg B to peg C. The solver completes the puzzle in exactly 63 moves.
Play Tower of Hanoi free in your browser. Choose 3 to 10 disks, click pegs to move disks, and track your move count against the optimal solution. Use the auto-solver to watch the recursive algorithm in action. The game saves your best move count per disk size locally. No downloads, no registration, works on desktop and mobile.
| Version | Difficulty | Players | Typical Time |
|---|---|---|---|
| 3 disks | Easy | 1 | 1-2 min |
| 4 disks | Easy | 1 | 2-3 min |
| 5 disks | Medium | 1 | 3-5 min |
| 6 disks | Medium | 1 | 5-8 min |
| 7 disks | Hard | 1 | 7-10 min |
| 8 disks | Hard | 1 | 8-12 min |
| 9 disks | Hard | 1 | 10-15 min |
| 10 disks | Expert | 1 | 15-20 min |
The minimum is 2^n - 1, where n is the number of disks. For 3 disks that is 7 moves, for 4 disks it is 15, and for 8 disks it is 255. This formula comes directly from the recursive structure of the solution.
Yes. The recursive algorithm moves n-1 disks to the spare peg, moves the largest disk to the target peg, then moves n-1 disks from the spare peg to the target. Repeating this at every level produces the optimal move count every time.
At one move per second, solving 64 disks takes about 585 billion years, which is roughly 42 times the age of the universe. This is the basis of the original legend Lucas created to accompany the puzzle.
Yes. Our version supports touch input. Tap a peg to pick up its top disk, then tap another peg to place it. The canvas scales to fit any screen size.
Tower of Hanoi pairs simple rules with deep mathematical structure. Whether you solve 3 disks in seconds or tackle 10 disks for a real challenge, every game teaches you something about recursion. Pick your disk count and start moving.
Classic mine-avoidance puzzle
Slide and merge to reach 2048
Classic snake growing game
Break bricks with a bouncing ball
Atari-style brick clearing with power-ups
Fast two-paddle arcade rallies
Classic alien shooter defense
Classic flipper and bumper arcade