Tower of Hanoi — Play Free Online

🗼How to Play Tower of Hanoi

Tower of Hanoi is a famous free online puzzle of logic and patience: move a whole stack of discs from one peg to another, one disc at a time, never placing a larger disc on a smaller one. Play in your browser with no download and no sign-up.

It is a classic introduction to recursive thinking and planning ahead, beloved by puzzle fans and computer scientists alike. Easy, Medium and Hard settings add more discs, and since each extra disc roughly doubles the minimum moves, the challenge grows quickly.

The puzzle was invented in 1883 by the French mathematician Édouard Lucas, who sold it as a toy under the anagram “N. Claus de Siam”. It came wrapped in a legend of his own devising: in a temple in Benares, priests labour to move a tower of 64 golden discs, and when the last disc falls into place the world will end. There is no cause for alarm — at one move per second, 64 discs take 2⁶⁴−1 moves, more than 580 billion years.

Beyond its status as a toy, the Tower of Hanoi is a workhorse of computer science and psychology. It is often the first recursive algorithm a programming student ever writes, and neuropsychologists use disc-moving tasks derived from it to assess planning and problem-solving in the frontal lobes. Few puzzles can claim to be both a children's toy and a standard laboratory instrument.

Objective

Move the entire tower of discs from the starting peg to the target peg, keeping the discs in order from largest at the bottom to smallest at the top.

Controls

Click or tap a peg to pick up its top disc, then click another peg to drop it there — or drag a disc directly from one peg to another. You may only move one disc at a time, and you can never place a larger disc on top of a smaller one.

Scoring

There is no point score; the puzzle is solved when the whole tower sits correctly on the target peg. The challenge is efficiency — the minimum number of moves for n discs is 2 to the power n, minus one (for example 7 moves for 3 discs, 15 for 4).

Tips & Strategy

Think recursively: to move a stack of n discs, first move the top n-1 discs to the spare peg, move the largest disc across, then move the n-1 discs on top of it. The smallest disc should move every other turn, always in the same direction, which keeps you on the optimal path.

FAQ

What is the rule of Tower of Hanoi?
Move one disc at a time and never place a larger disc on top of a smaller one.

What is the fewest moves needed?
For n discs the minimum is 2 to the power n minus 1 moves, so three discs take 7 and four take 15.

Is it free?
Yes, play free in your browser with no download or sign-up.

More classic games: Peg Solitaire · Sliding Puzzle · Tangrams · Sudoku · Maze Escape · all 100 free games