FAQ
Tower of Hanoi FAQ
Answers about the free Tower of Hanoi puzzle — price, the minimum number of moves, how many disks you can play, the legend behind it, mobile play, saved progress, and controls.
Play Tower of HanoiAnswers for the Tower of Hanoi puzzle
This FAQ is the long-form reference for playtowerofhanoi.com: the free browser version of the Tower of Hanoi, the three-peg disk puzzle Édouard Lucas published in 1883. It covers how to start, the three rules, the 2^n − 1 optimal move count, and why progress lives on your device.
For a full walkthrough of the rules, read how to play the Tower of Hanoi. For the solving method, see the strategy page. To play now, open the board.
Getting started
What the Tower of Hanoi is, whether it is free, and how to start a puzzle in your browser.
What is the Tower of Hanoi?
The Tower of Hanoi is a single-player logic puzzle invented by the French mathematician Édouard Lucas in 1883. You start with a stack of graduated disks on one of three pegs and must rebuild the whole stack on another peg, moving one disk at a time and never placing a larger disk on a smaller one. It is a classic teaching example of recursion in mathematics and computer science.
Is the Tower of Hanoi free to play online?
Yes. playtowerofhanoi.com is completely free and runs entirely in your browser. There is nothing to buy, download, or install, and there are no interruptive video ads, premium tiers, or paywalls. Open the page and a puzzle is ready.
Do I need to download an app or create an account?
No. The puzzle is the website — a 100% browser-based build with no app-store download and no sign-up. Your best moves and times are saved locally in your browser, so there is no login to manage.
Where does the Tower of Hanoi come from?
It was published as a toy in 1883 by Édouard Lucas under the pen name "N. Claus de Siam", an anagram of "Lucas d'Amiens". It came with a story about priests in a temple moving 64 golden disks between diamond pegs, with the world ending when they finish. The maths, not the legend, is why it endured.
Rules and moves
The three rules, the goal peg, the minimum number of moves, and how many disks you can play.
How do you play the Tower of Hanoi?
Move the entire stack of disks from the left peg to the right peg. You may move only the top disk of a peg, only one disk per move, and you may never set a larger disk on top of a smaller one. Tap a peg to lift its top disk, then tap the destination peg to drop it. The puzzle is solved when every disk is stacked in order on the right peg.
What is the minimum number of moves for the Tower of Hanoi?
For n disks the minimum is 2 to the power of n, minus one. That is 7 moves for 3 disks, 15 for 4, 31 for 5, 63 for 6, 127 for 7, and 255 for 8. No solution can ever do it in fewer moves, and exactly one optimal sequence exists for each starting position. The game shows your move count against this target as you play.
How many disks can I play with?
You can choose any number of disks from 3 to 8. Three disks solve in 7 moves and take under a minute; eight disks need at least 255 moves and are a serious test of the pattern. Your stats are tracked separately for each disk count.
Which peg do I have to finish on?
This version asks you to move the stack to the right-hand peg, which is the standard statement of the puzzle. The left peg is the start and the middle peg is the spare you use for staging. The hint and move target are both calculated toward the right peg.
What are the controls?
Tap or click a peg to lift its top disk, then tap another peg to drop it; tap the same peg again to cancel. You can also drag a disk from one peg to another. On the keyboard, press 1–3 to choose a source peg and then a destination, U to undo, H for a hint, R to restart, N for a new puzzle, and M to mute.
Can I move disks back to the starting peg?
Yes. Any legal move is allowed at any time, including moving disks back onto the left peg. The optimal solution actually requires shuttling disks among all three pegs — the starting peg included — many times before the tower is finished.
Solving and strategy
The recursive method, the by-hand three-move cycle, and how to reach the optimal move count.
What is the trick to solving the Tower of Hanoi?
Two moves repeated forever. First, never move the smallest disk twice in a row. Second, on every other turn move the smallest disk one peg in a single fixed direction around the three pegs; on the turns in between, make the only other move that is legal. Keep going and the tower rebuilds itself in the optimal number of moves.
Why is the Tower of Hanoi used to teach recursion?
Because the solution is defined in terms of itself. To move n disks, you move n − 1 disks out of the way, move one disk, then move the n − 1 disks back — and each of those is the same problem with a smaller stack. That structure maps directly onto a recursive function that calls itself twice with n − 1, which is why it appears in almost every programming course.
Is every Tower of Hanoi puzzle solvable?
Yes. Unlike shuffled card games, the Tower of Hanoi always has a solution from the standard starting position, and that solution is unique if you want the fewest moves. If you get tangled, undo back to a position you understand — you can never reach a truly stuck state.
What does the hint do?
The hint flashes the single best next move from wherever you are — not just from the start. It is computed from the optimal solution for your current position, so following hints all the way through always finishes in the minimum number of moves. Using a hint marks that solve as assisted, so it does not count toward your perfect-solve total.
How long would 64 disks take?
The legend attached to the puzzle imagines 64 golden disks. At the optimal 2 to the power of 64, minus one moves — about 18.4 quintillion — and one move per second, finishing would take roughly 585 billion years, far longer than the current age of the universe. This game caps disks at 8 for that reason.
What counts as a perfect solve?
Solving the puzzle in exactly 2 to the power of n, minus one moves — the theoretical minimum — without using a hint. Perfect solves are tracked per disk count so you can chase an optimal run at every size from 3 disks up to 8.
Devices, saving, and the legend
Mobile play, supported browsers, local progress, and the story the puzzle is named after.
Does the puzzle save my progress?
Your fewest moves, fastest time, puzzles solved, and perfect solves are saved locally in your browser for each disk count from 3 to 8. Nothing is sent to a server and there is no account. Because the save lives on the device, a different phone, a new browser profile, or cleared site data looks like a fresh start. A puzzle in progress is not saved if you close the tab.
Can I play the Tower of Hanoi on mobile?
Yes. The layout is built for touch: tap a peg to pick up its top disk and tap another peg to drop it. All three pegs and up to eight disks fit on one portrait screen, and starting a new puzzle is instant with no page reload.
Which browsers are supported?
Any current browser with JavaScript: Chrome, Edge, Firefox, and Safari on desktop, plus their mobile versions. If disks do not respond, update the browser, allow scripts for this site, and reload.
How do I reset my stats?
Open Stats from the game bar and use Reset progress, then confirm with the second tap. That clears fewest moves, fastest time, puzzles solved, and perfect solves for every disk count on this browser. It cannot be undone.
Still have a question?
Rules not listed here follow the standard puzzle: one disk per move, only the top disk of a peg, and never a larger disk on a smaller one. For who publishes the game or a bug report, use About Us. Legal details are on Privacy and Terms.
Play Tower of Hanoi free