🗼

Tower of Hanoi

Move all discs to the rightmost peg in the fewest moves!

Share:PostRedditShare
📖
Related Article
How to Solve Tower of Hanoi | Step-by-Step Puzzle Guide

You might also like

🧠
Memory Match
⏱️
Timed Memory Match
⌨️
Typing Speed
Reaction Time

Frequently Asked Questions about Tower of Hanoi

How do you play Tower of Hanoi?
Move all discs from the left peg to the right peg. You can only move one disc at a time, and you can never place a larger disc on top of a smaller one. Try to solve it in the minimum number of moves!
Is Tower of Hanoi free?
Yes! Tower of Hanoi is completely free to play in your browser. Choose from 3 to 7 discs with move tracking. No downloads needed.
What is the minimum number of moves for Tower of Hanoi?
The minimum moves required is 2^n minus 1, where n is the number of discs. So 3 discs takes 7 moves minimum, 4 discs takes 15, 5 discs takes 31, 6 discs takes 63, and 7 discs takes 127.
What is the best strategy for Tower of Hanoi?
Always move the smallest disc first, alternating it between pegs in a consistent direction. Then make the only legal move available with the remaining discs. This pattern solves any Tower of Hanoi optimally.

About Tower of Hanoi

Tower of Hanoi is a legendary mathematical puzzle invented by French mathematician Edouard Lucas in 1883. The challenge is deceptively simple: move a stack of differently-sized discs from one peg to another using a third peg as an intermediary. The rules are strict, allowing only one disc to be moved at a time and never placing a larger disc on top of a smaller one. The minimum number of moves required follows the formula 2 to the power of n minus 1, so 3 discs need 7 moves while 7 discs require 127 moves. PlayBrain lets you choose between 3 and 7 discs, with a move counter tracking your efficiency. This puzzle is widely used in computer science education to teach recursive algorithms and problem decomposition. Play it free in your browser with no download.

How to Play

  1. Click or drag a disc from the top of any peg and place it on another peg.
  2. You may only move one disc at a time, and a larger disc can never sit on top of a smaller one.
  3. Move all discs from the leftmost peg to the rightmost peg to solve the puzzle.
  4. Try to solve it in the minimum number of moves (2^n minus 1, where n is the number of discs).