What Is Tower of Hanoi?

A free online Tower of Hanoi puzzle game. Challenge yourself with 3-7 disks and move the entire stack from peg A to peg C. You can only move one disk at a time and you can never place a larger disk on a smaller one. Use the Auto Solve feature to watch the optimal recursive solution in action, perfect for understanding algorithmic thinking.

Why Use Tower of Hanoi?

  • 3-7 disks with interactive drag-free peg clicking
  • Auto Solve demonstrates the optimal recursive solution
  • Move counter tracks your progress
  • Visual win detection with congratulations

How to Use Tower of Hanoi — Step by Step

1

Choose the number of disks (3-7).

2

Click a peg to pick up the top disk.

3

Click another peg to place it.

4

Move all disks to peg C to win!

Who Is Tower of Hanoi Best For?

  • puzzle lovers
  • programming students
  • math enthusiasts
  • problem solvers

Tower of Hanoi — Frequently Asked Questions

What is the minimum number of moves?

For n disks, the minimum is 2ⁿ - 1 moves. For 4 disks, that's 15 moves. For 7 disks, that's 127 moves.

Why can't I place a larger disk on a smaller one?

That's the rule! The puzzle requires that disks are always in decreasing size from bottom to top on every peg.

Ready to Use Tower of Hanoi?

Free online tool — works in your browser, no sign-up required. Start using it right now.

Try It Now
Free Forever · No Sign-up

179 Free Tools at Your Fingertips

All free online tools for developers, designers, students, and creators. Every tool works in your browser — no sign-up, no data collection.