🗼 Tower of Hanoi
Five discs, three pegs, one perfect 31-move solution — can you find it?
How to play Tower of Hanoi
How to play
Tower of Hanoi is one of the oldest and most satisfying puzzles in the world. Five discs sit stacked on the left peg, largest at the bottom and smallest on top. Your mission: move the entire tower to either of the other two pegs. The rules are simple but strict — move only one disc at a time, pick up only the top disc of a peg, and never place a larger disc on top of a smaller one. The perfect solution takes exactly 31 moves; every extra move is a detour you get to learn from.
Controls
Click or tap a peg to pick up its top disc, then click or tap the peg where you want to drop it. Tapping the same peg again cancels your pick-up. Keyboard players can press 1, 2, or 3 to select each peg in order. The Restart button resets the puzzle instantly.
Tips
The classic winning rhythm: move the smallest disc every second move, always in the same direction around the pegs. Think recursively — to move five discs, first move the top four out of the way, shift the big disc across, then rebuild the four on top of it. If you feel lost, stop and work backwards from your goal: ask which disc needs to move next and where it must go. Keep a steady rhythm and the tower practically builds itself.
Scoring
Your move count is tracked against the 31-move par. Hit 31 exactly for a Perfect rating, 45 or fewer for Excellent, 70 or fewer for Great, and anything beyond still earns a Solver's medal for finishing. The results screen rates your run — then challenges you to beat it.