Best Free Tower of Hanoi Game

Move the whole stack of disks to the last peg — never a larger disk on a smaller one.

Moves: 0 · Optimal: 7 · Disks: 3

Tap a peg to pick up its top disk, then tap another peg to drop it. A disk can only sit on a larger disk or an empty peg. Move the whole stack to the right peg.

Level 1 press P to pause
Love Best.Free? Share it

How to play

  1. Pick up a disk. Tap a peg to lift its top disk; tap the same peg again to put it back.
  2. Drop it legally. Tap another peg to drop the disk — only onto a larger disk or an empty peg, never onto a smaller one.
  3. Rebuild on the last peg. Move the entire stack to the right-hand peg, and try to match the optimal move count.

About the Tower of Hanoi

The Tower of Hanoi is a classic logic puzzle. You start with a stack of disks on the left peg, largest at the bottom and smallest on top, and three pegs to work with. Tap a peg to pick up its top disk, then tap another peg to drop it — but a disk may only rest on a larger disk or on an empty peg, so you can never stack big on small. Your task is to rebuild the whole tower on the right-hand peg. The game tracks your moves against the known optimal of 2^N − 1, so you can see how efficient your solution is. Choose 3 disks to warm up or 7 for a real test. No signup, no download.

Frequently asked questions

Tap a peg to pick up its top disk, then tap another peg to drop it there. You can only ever move one disk at a time, and a disk may only be placed on a larger disk or on an empty peg. The aim is to move the entire stack to the last peg.

You can never put a larger disk on top of a smaller one. That single restriction is what makes the puzzle interesting — you have to shuffle smaller disks out of the way to free the bigger ones.

For N disks the optimal solution takes 2^N − 1 moves: 7 for 3 disks, 31 for 5, and 127 for 7. The game shows this optimal number so you can compare it with your own move count.

They set the number of disks: Easy is 3 disks, Normal is 5, and Hard is 7. Each extra disk roughly doubles the moves a perfect solution needs.

Yes. Tap a peg to lift its top disk and tap another to drop it. The pegs scale to your screen, so it plays well on phones and tablets.

Completely free, with no signup and no download — it runs entirely in your browser.

No. Tower of Hanoi works with no signup at all; an optional free account only exists to unlock higher usage limits.

Usually just a few seconds for a typical file — Tower of Hanoi starts working the moment you give it your input.

Your input is processed in memory and never stored, so nothing is left behind once you have your result.

All modern browsers — Chrome, Safari, Firefox and Edge. Tower of Hanoi needs nothing installed beyond the browser you already use.

← All games

Rate this page
5.0/5 (0)

What could we improve? Your feedback helps us fix issues.