Tower of Hanoi
Move the whole tower in the fewest moves.
↑ This is Tower of Hanoi running right here in your browser — no download needed.
About the game
The Tower of Hanoi is a recursive puzzle: transfer a stack of disks from one peg to another, never placing a larger disk on a smaller one.
How to play
Move one disk at a time, always onto an empty peg or a larger disk. Relocate the entire stack to the target peg to win.
Tips & strategy
['Always move the smallest disk on every other turn in the optimal pattern.', 'The optimal sequence alternates directions based on disk count.', 'Use the spare peg as temporary holding.']
Advanced guide
The Tower of Hanoi solves itself with one rule: repeatedly move the smallest disk, sending it to the next peg in a direction that depends on whether the total is odd or even, and fill the gap with the only other legal move. Internalize that cycle and any size becomes mechanical.
History & origins
Invented by Edouard Lucas in 1883, the puzzle elegantly demonstrates recursion and exponential growth.
Frequently Asked Questions
What is the minimum number of moves?
For n disks, it is 2^n - 1.
Why can't I put a big disk on a small one?
That is the only rule, and it is what creates the challenge.
Is there a formula for the solution?
Yes - always move the smallest disk, alternating pegs in a fixed cycle.
Does the number of disks matter?
Each extra disk doubles the moves plus one.
What is the trick for 3 disks?
Follow the cycle: move smallest to the opposite peg, then the other disk, repeat.
Why is it used in computer science?
It is the classic example of a recursive algorithm.
Where can I play Tower of Hanoi for free?
Right on this page — Tower of Hanoi is embedded above, free, legal, and with no download or sign-up. Play with your keyboard on desktop or touch controls on mobile. Your best score is saved in your browser, so it's still there next time. Every game here is original or open-source, with links that stay valid.