← All text tools

Tower of Hanoi Game

Move a stack of 3 to 10 discs between three pegs without putting a larger disc on a smaller one, with a move counter, the minimum and auto-solve.

  • Free
  • No sign-up
  • Works on any device

About Tower of Hanoi Game

Move a stack of discs from Peg A to Peg C. You can move only one disc at a time, only the top disc of a peg, and never put a larger disc on a smaller one. With n discs the shortest solution takes 2 to the power of n minus 1 moves: 7 moves for 3 discs, 31 for 5 and 1,023 for 10. The page shows your move count beside that minimum, and tells you when you have solved it perfectly. Auto-solve restarts the puzzle and plays the shortest solution at the speed you choose.

How to use Tower of Hanoi Game

  1. Choose the number of discs, from 3 to 10.
  2. Click the peg you want to move from, then the peg you want to move to.
  3. Get all discs onto Peg C and compare your moves with the minimum, or try Auto-solve.

Why use this tool?

Also known as

Frequently asked questions

What is the minimum number of moves?

2 to the power of the number of discs, minus 1. For 4 discs that is 15 moves and for 8 discs it is 255.

What is the rule for moving discs?

Move one disc at a time, take only the top disc from a peg, and never place a larger disc on top of a smaller one.

What does Auto-solve do?

It resets the puzzle and plays the optimal solution step by step. Click any peg to stop it and take over.

Is Tower of Hanoi Game free?

Yes. Tower of Hanoi Game on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Tower of Hanoi Game on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools