DailyRanks

How to Play Tower of Hanoi

Rules and solving tips for the Tower of Hanoi, for first-time players.

Tower of Hanoi rules

  1. 1

    There are three rods. Disks of different sizes are stacked on the left rod, largest at the bottom and smallest at the top.

  2. 2

    Move only one disk at a time. Each move takes the top disk from one of the rods.

  3. 3

    A disk can go on an empty rod or on top of a larger disk. You can never place a larger disk on a smaller one.

  4. 4

    Move the whole stack, in the same order, to the right rod to solve the puzzle.

  5. 5

    The minimum number of moves is 7 for 3 disks, 15 for 4, 31 for 5, 63 for 6, 127 for 7 and 255 for 8. Each extra disk roughly doubles it.

Tips for solving it in the minimum moves

Play Tower of Hanoi →

FAQ

Is the Tower of Hanoi free to play?

Yes, and there's no sign-up. Play right in your browser on a phone, tablet or computer.

What is the minimum number of moves?

With n disks, the minimum is 2 to the power of n, minus 1: 7 moves for 3 disks, 15 for 4, 31 for 5, 63 for 6, 127 for 7 and 255 for 8.

How many disks should I start with?

Start with 3 disks. Once you can solve it in 7 moves, add one disk at a time.

Can I undo a move?

Yes. Undo takes back one move at a time, and the move counter goes back too.

What does the hint show?

It shows the next move of the shortest solution from your current position: which disk to move and which rod to move it to.

Can I continue later?

Yes. On the same device and browser, you can pick up where you left off for each number of disks.

More games

SolitaireClassic Klondike. Every deal is checked to be winnable.SudokuSeven levels, Easy to Evil. Every puzzle has exactly one solution.Mahjong SolitaireClear the board by matching pairs of tiles.Spider SolitaireBuild runs from King to Ace. Every deal is verified winnable.CheckersThe classic jump-and-capture board game. Five computer levels, or play a friend on the same device.FreeCellFour free cells, pure strategy. Classic game numbers, every deal verified winnable.HeartsThe classic trick-taking card game. Play against 3 computer opponents.Reversi (Othello)The classic disc-flipping board game. Five computer levels, or play a friend on the same device.GomokuGet five in a row before your opponent. A 15×15 board, five computer levels, or play a friend on the same device.MancalaSow stones and fill your store. The popular six-pit, four-stone rules, five computer levels, or play a friend on the same device.Four in a RowDrop discs and line up four before your opponent. A 7×6 board, five computer levels, or play a friend on the same device.Five DiceRoll five dice up to three times, make combinations and fill 15 boxes. Go for a high score solo, or play the computer or a friend.Tic-Tac-ToeGet three in a row before your opponent on a 3×3 grid. Five computer levels, or play a friend on the same device.Mahjong ConnectJoin matching mahjong tiles with a line of up to two turns. Three board sizes up to the classic 8×17. Every deal can be cleared.DaifugoThe Japanese climbing card game: be first to empty your hand. 8-stop, revolution and the card exchange, 5 rounds against 3 computer players.Gin RummyDraw, discard and meld your hand into sets and runs. Knock with 10 or less deadwood or go gin. One-on-one against the computer, first to 100 wins.Word SearchFind the hidden words across, down and diagonally. Ten themes, three sizes from 8×8 to 15×15, a new puzzle every time, and printable.SevensBuild each suit out from the 7s and be first to empty your hand. Up to 3 passes per round, 5 rounds against 3 computer players.Sliding PuzzleSlide the tiles into the empty space to put the numbers in order. 3×3, 4×4 (the classic 15 puzzle) and 5×5. A new, solvable puzzle every time.Yukon SolitaireA Klondike-style solitaire with no stock pile. Any face-up card moves together with the cards on top of it. Every deal can be won.Scorpion SolitaireBuild down in suit and complete four columns from King to Ace. Any face-up card moves together with the cards on top of it.SpadesThe classic partnership card game where spades are trump. Team up with a computer partner.BackgammonRoll the dice and race your 15 checkers home. Five computer levels, or play a friend on the same device.2048Slide and merge matching tiles to reach 2048. Boards from 3×3 to 6×6, with undo.MazeDrag from start to exit. 8×13 to 30×53, a new maze every time, and printable.NonogramFill the grid from row and column number clues. 5×5 to 20×20, every puzzle solvable by logic alone.Matching GameTurn over two cards and match the pictures. Animals, food and vehicles, 8 to 24 pairs.ConcentrationThe classic memory card game: turn over two cards and match pairs. Four levels, 8 to 24 pairs.TriPeaks SolitaireChain cards one higher or lower to clear three peaks of cards.Golf SolitairePlay cards one higher or lower to clear all seven columns. Every deal is winnable.Pyramid SolitairePair cards that add up to 13 to clear the pyramid. Every deal is winnable.MinesweeperOpen every safe cell using the numbers. Every board can be solved by logic alone.Killer SudokuNo given numbers. Solve it from the cage sums alone.