Three pegs, a stack of rings and one strict rule: a bigger ring can never sit on a smaller one. Tower of Hanoi unblocked is a famous logic puzzle that also teaches a neat pattern in math. Rebuild the stack on the right peg in as few moves as possible. Classroom 7x hosts it directly, so it runs in Chrome with nothing to install.
About Tower of Hanoi
This version of the classic puzzle was made by Douile and released as open-source code. It is drawn on a plain black canvas with three pegs and a stack of colored rings that starts on the left peg, largest at the bottom. A counter in the top corner compares your move count with the lowest possible total, for example 9/7. Finishing the stack on the right peg triggers a short zoom on the board as a celebration.
The starting puzzle uses three rings and takes seven moves at best. Use the plus icon for more rings or the minus icon for fewer, down to a minimum of three, and each change starts a new puzzle. Every extra ring roughly doubles the moves needed, so the challenge grows quickly. If you want to see how it is done, a play icon runs the perfect solution automatically while you sit back and watch.
How to Play Tower of Hanoi
- Choose a peg with a click or tap, and its top ring rises up to hover above it.
- Click or tap a different peg to set that ring down on top of it.
- Place a ring only on an empty peg or on top of a larger ring.
- Keep moving rings until the whole stack sits on the right-hand peg.
- Compare your move count with the minimum shown, then add a ring for a bigger challenge.
Tower of Hanoi Controls
| Input | Action |
|---|---|
| Click a peg | Pick up or drop a ring |
| Left / Right arrows or A / D | Move the selection between pegs |
| Space, Enter, Up / Down or W / S | Pick up or drop a ring with the keyboard |
| R or restart icon | Restart the puzzle |
| Plus / minus icons | Add or remove a ring |
| Play icon | Watch the puzzle solve itself (press again to stop) |
| Tap (touch screens) | Tap one peg to pick up, then a second peg to drop |
How to Play Tower of Hanoi on PC & Chromebook
Tower of Hanoi works with either a mouse or the keyboard on a Chromebook or laptop. Clicking a peg lifts its top ring, and clicking another peg drops it. If you prefer keys, the left and right arrows move between pegs and Space picks up or drops a ring. The icons in the corner handle restart, ring count and the automatic solver.
- Open the puzzle and look at the move counter in the corner.
- Click a peg to lift a ring, then click another peg to place it.
- Or use the arrows to choose a peg and Space to lift or drop.
- Press R or the restart icon to try again with fewer moves.
Desktop tip: Keyboard play is quick once you learn it. Keep one finger on Space and use the arrows to slide between pegs.
How to Play Tower of Hanoi on Mobile
Tower of Hanoi plays easily on phones and tablets. One tap on a peg picks up its top ring, and a tap on a different peg places it there. The small icons in the bottom corner let you restart, change the number of rings or watch the solver. The pegs are large targets, so taps rarely land in the wrong place, and the puzzle works in either orientation.
- Open the puzzle in your phone or tablet browser.
- Pick up the top ring by tapping its peg.
- Drop it by tapping the peg where it should go.
- Tap the plus icon when you are ready for more rings.
Mobile tip: Count each tap pair as one move. Planning two or three moves ahead keeps your counter close to the minimum.
Tips and Tricks
- Check whether you have an odd or even number of rings. With an odd count, move the smallest ring to the right peg first; with even, use the middle.
- Use the smallest ring every second move. When the puzzle is solved perfectly, that ring keeps circling the pegs in one direction.
- On the turns between, look for the only legal move that does not involve the smallest ring. There is always exactly one.
- Break big stacks into smaller ones. To move four rings, first move the top three aside, shift the largest ring, then rebuild the three on it.
- Run the solver once on four rings and watch closely. The repeating rhythm becomes easy to spot when you see it play out.
Game Info
| Game | Tower of Hanoi |
|---|---|
| Developer | Douile |
| Genre | Puzzle, Learning |
| Players | Single player |
| Works on | Chromebook, PC, Mac, tablet and phone |
| Price | Free, no sign-up |
| Hosting | Served from Classroom 7x's own servers |
| License | MIT (original source, license, credits) |
Tower of Hanoi FAQ
What is the fewest moves for each number of rings?
The minimum is two raised to the number of rings, minus one. Three rings need 7 moves, four need 15, and five need 31. The counter shows this target after the slash.
Does putting a ring back on the same peg count?
Yes. Every drop adds one to the move counter, even if the ring goes back where it started. Think about where a ring is going before you lift it.
Can I take over after stopping the solver?
Not really. Stopping the solver and starting it again begins from the beginning. Use it to learn the pattern, then restart and solve the puzzle on your own.













