
Tower of Hanoi
Move a stack of seven colored disks to another peg, never placing a bigger disk on a smaller one, in this free Tower of Hanoi puzzle for your browser.
About Tower of Hanoi
Tower of Hanoi is the timeless logic puzzle with three pegs and a stack of seven colored disks. Your job is to move the whole tower from the left peg to one of the other two, one disk at a time, without ever putting a larger disk on top of a smaller one.
The rules take seconds to learn, but the solution rewards careful thinking: the shortest possible answer takes exactly 127 moves. A move counter tracks every step and three stars show how close you are to perfect, dropping as extra moves pile up. Once you spot the recursive pattern hidden in the puzzle, the tower almost builds itself.
It is a calm brain teaser for puzzle fans, students learning about recursion and anyone who wants to train patience and planning.
How to play
Click or tap a peg to lift its top disk, then click another peg to drop it there. A disk can only go on an empty peg or on a larger disk; click the same peg again to put it back. Move all seven disks onto the middle or right peg to win, using as few moves as possible.
Controls
- Click / Tap peg
- Lift the top disk or drop the held disk
- Click / Tap restart icon
- Restart the puzzle
Tips
- With an odd number of disks like seven, move the smallest disk to the peg where you want the tower to end up first.
- Move the smallest disk every other turn, always cycling in the same direction around the pegs.
- On the turns between, make the only legal move that does not involve the smallest disk.
- Aim for the perfect 127 moves to keep all three stars.
Screenshots
FAQ
Is Tower of Hanoi free to play?
Yes. It is completely free and runs in your browser with no download or account needed.
Can I play it on a phone or tablet?
Yes. Just tap the pegs to move the disks; the board scales to fit the screen.
What is the minimum number of moves?
With seven disks the best possible solution takes 127 moves (2 to the power of 7, minus 1). Finish in 127 to keep all three stars.






