AbraCalc

Tower of Hanoi

Solve the Tower of Hanoi puzzle in your browser. Move all discs to the rightmost peg!

Tower of Hanoi
Moves: 0   Best possible: 7

Click a peg to pick up / place the top disc

Embed this tool on your site

How to play

  1. Click a peg to pick up its top disc (it will highlight in orange).
  2. Click another peg to place the disc there — you can't place a larger on a smaller.
  3. Move all discs from Peg A to Peg C using as few moves as possible.
  4. Select 3, 4, or 5 discs using the dropdown; click Restart any time.

Click a peg to select the top disc, then click another peg to move it. You can only place a smaller disc on a larger one. Move all discs to Peg C!

Frequently asked questions

What is the minimum moves?
The minimum number of moves is 2^n − 1. For 3 discs that is 7, for 4 discs 15, and for 5 discs 31.
Can I move any disc?
No — you can only move the topmost disc from any peg, and never place a larger disc on a smaller one.