Skip to content
NexoraPlay
Tower of Hanoi

Tower of Hanoi

Move the whole tower, one disc at a time.

Embed

Paste this code into your page or blog. The game plays right there, free, with no sign-up — and your visitors can find more games at Nexora Play.

Embedded games keep best scores on the player's device. Saved progress, accounts and leaderboards need the full page on Nexora Play.

Report

What kind of report?

Don't include your name, email, phone number or other personal details. We remove emails and phone numbers automatically. Privacy policy

Play more

Picked for you: switch lists to find your next game

About Tower of Hanoi

Also called Tower of Brahma, towers of Hanoi, Lucas tower, disc stacking puzzle, Hanoi puzzle.

The Tower of Hanoi puzzle online, free in your browser: move a stack of discs from one peg to another, one disc at a time, never putting a bigger disc on a smaller one. The Temple Steps is a path of 36 levels that unlock one by one, from 3 discs up to 8. Each size opens with the full tower, then moves on to mid-game puzzles where the discs are already spread across the pegs and the challenge is to finish in the fewest moves. Late levels add a fourth peg. Every level shows its par, the fewest moves possible, worked out by the game's own solver. Finish at par for three stars, a little over for two. A hint shows the best next move, undo takes one back, and a refused drop tells you why. The pegs stand before a dusk temple with paper lanterns, with a Baroque canon in bell tones. Click, tap or use the keyboard. It is the classic maths puzzle also called the Tower of Brahma.

How to play

Click or tap a peg to lift its top disc, then click another peg to drop it there. A bigger disc can never sit on a smaller one. Rebuild the tower on the right-hand peg in as few moves as you can; the par shows on the board. Keys 1, 2 and 3 (and 4 on four-peg levels) pick a peg directly, or Left and Right choose a peg and Enter, Space, Up or Down lift and drop. H gives a hint, U or Z undoes, R restarts, P or Esc pauses.

Controls
ActionKeyboardTouch
Lift and drop a discClick a peg1, 2, 3 (4)Left/Right + EnterTap a peg, then another
Pick a level on the menuArrowsEnterTap a level
HintHHINT button
UndoUZUNDO button
Restart the levelRRESTART button
PausePEsc—

Tips for Tower of Hanoi

  • The smallest disc moves on every other turn, always round the pegs in the same direction.
  • On the moves between, there is only ever one legal move that does not touch the smallest disc. Make it.
  • With an odd number of discs, send the smallest disc first to the peg where you want the tower to end.
  • To move a tower of n discs, first move the top n − 1 out of the way, move the biggest, then rebuild on top.
  • In mid-game levels, find the biggest disc that is not yet home and work out what must move to free it.
  • The par is the fewest moves possible. Use a hint to see the best next move if you are not sure.

Questions about Tower of Hanoi

How do the levels and stars work?

The Temple Steps has 36 levels that unlock in order, from 3 discs to 8. Each size starts with the full tower and then gives mid-game puzzles with discs spread over the pegs. Finish at par for three stars, within a quarter over par plus two for two stars, otherwise one.

What is the minimum number of moves for the Tower of Hanoi?

A full tower of n discs needs 2ⁿ − 1 moves at the very least: 7 for 3 discs, 15 for 4, 31 for 5, 63 for 6, 127 for 7 and 255 for 8. Each level here shows its par, the exact minimum from that position.

What is the trick to solving the Tower of Hanoi?

Move the smallest disc every other turn, always in the same direction round the pegs, and in between make the only legal move that does not use it. That simple rule finishes any full tower in the fewest moves.

Why can't I drop a disc on a peg?

A bigger disc can never go on top of a smaller one. The game refuses the drop and tells you why, so you can choose another peg instead.

Can I play with the keyboard?

Yes. Press 1, 2 or 3 to pick a peg, or use Left and Right to choose and Enter, Space, Up or Down to lift and drop. H hints, U or Z undoes, R restarts and P or Esc pauses. Every move is announced for screen readers.

Is Tower of Hanoi free?

Yes. Tower of Hanoi is free to play on Nexora Play, with no download and no sign-up needed.

Can I play Tower of Hanoi on my phone?

Yes. It runs in the browser on computers, tablets and phones, with touch controls on phones and tablets. You can also add Nexora Play to your home screen like an app.

Do I need an account?

No. You can play as a guest and your best scores are kept in this browser. A free account (13+) keeps your progress across devices.

More puzzle games