Tower of Hanoi — Classic Disk Logic Puzzle Online

Play Tower of Hanoi free online. Move the whole stack of disks to the far peg, never placing a larger disk on a smaller one. Solve it in the fewest moves.

#classic #logic #brain-teaser #single-player

How to play

Tap a peg to lift its top disk, then tap another peg to drop it. Never stack a larger disk on a smaller one. Move the tower to the right peg.

About Tower of Hanoi — Classic Disk Logic Puzzle Online

Tower of Hanoi is one of the most famous logic puzzles ever invented. Three pegs stand side by side, and a neat pyramid of different-sized disks is stacked on the first one — largest at the bottom, smallest on top. Your goal is to rebuild that whole tower on the far peg, moving one disk at a time, with a single unbreakable rule: a larger disk may never rest on a smaller one.

It looks simple with three disks, but the puzzle hides beautiful structure. The fewest moves needed is always exactly 2ⁿ − 1 — seven moves for three disks, fifteen for four, and a thousand-plus once you reach ten. The trick is the same at every size: to move a stack, you first move everything above the bottom disk out of the way, shift the big one, then rebuild on top. Spotting that pattern is the puzzle's famous 'aha' moment.

This version runs instantly in any browser on phone, tablet or desktop — no download, no sign-up, completely free. Just tap a peg to pick up its top disk and tap another to set it down. Each tower you solve adds another disk, and the game tracks your move count against the perfect 2ⁿ − 1 target, so there's always a tighter solve to chase. It's a clean, timeless brain workout you can enjoy in a minute or master over many.

Tips & strategy

  • Think in stacks, not single disks. To move a tower of k disks, you must first move the top k − 1 disks onto the spare peg, move the bottom disk across, then move that k − 1 stack back on top.
  • The smallest disk moves every other turn, and it always travels in one consistent direction. Keep its rhythm and you'll rarely go wrong.
  • Never undo your last move. If you just placed a disk and immediately want to move it back, you're looping — advance a different disk instead.
  • Plan where the bottom disk needs to end up first, then work out how to clear everything off it. The whole solution hangs on freeing that largest disk exactly once.
  • The target is 2ⁿ − 1 moves: 7, 15, 31, 63… If your count climbs far past that, you're shuffling disks back and forth — step back and find the pattern.
  • Use the spare peg deliberately. Every move should either advance the small stack or free the big disk; a move that does neither is usually wasted.
  • Master three disks until it's automatic, then add one at a time. Each larger tower is just the previous puzzle wrapped around one more disk.

Frequently asked questions

How do I play Tower of Hanoi?

Tap a peg to lift its top disk, then tap another peg to drop it there. Move the entire stack from the left peg to the right peg. You may only move one disk at a time and can never place a larger disk on top of a smaller one.

What is the minimum number of moves?

For n disks the fewest possible moves is exactly 2ⁿ − 1 — so 7 for three disks, 15 for four, 31 for five, and so on. The game shows this as your 'Goal', and your Best score is the fewest moves you've used at that size.

Why can't I drop this disk here?

A disk can only be placed on an empty peg or on top of a larger disk. If the disk you're holding is bigger than the one on the target peg, the move isn't allowed — find somewhere else for it first.

How do disks and levels work?

The level is simply the number of disks, starting at three. Each time you complete a tower the game adds one more disk (up to eight), making the puzzle longer and the optimal solution larger.

Does my progress save?

Yes — your current disk count and your best move counts per size are stored in your browser, so you can close the tab and continue on the same device. The Start button reads 'Continue' when a saved game exists.

Is Tower of Hanoi free and good on mobile?

It's completely free, with no install or sign-up, and built mobile-first — big tap targets on each peg and a layout that fits any screen, so it plays as well on a phone as on a desktop.