For larger controls, rotate your phone or choose Expand above the game.
How to play Tower of Hanoi
Play Tower of Hanoi online free with 3, 4, or 5 disks. Move the tower between pegs, follow the classic size rule, and chase the minimum solution.
Objective, rules, and result
Move the full stack from the left peg to the right peg, one top disk at a time, without ever placing a larger disk on a smaller one. The theoretical minimum is 2^n - 1 moves for n disks.
How to play
- Tap a tower to lift its top disk, then tap the destination tower.
- Never place a larger disk on top of a smaller disk.
- Move the entire stack to the right tower and try to match the minimum move count.
Controls
Keyboard and mouse: Click towers or press 1–3.
Touch: Tap a source tower, then a destination.
Shortcuts: U: undo; H: optimal hint.
Strategies to try
- For an odd number of disks, begin the smallest disk toward the destination; for an even number, begin toward the spare peg.
- Alternate a smallest-disk move with the only other legal move.
Device and accessibility notes
Select pegs by click or tap, or use number keys 1 through 3; U undoes and H shows an optimal hint. Disk widths communicate size without relying only on colour.
Use the Settings control above the game to turn sound or vibration off and to reduce interface motion. Expand mode can provide a larger play area. Records are stored only in this browser when storage is available.