Released

Tower of Hanoi

Play Tower of Hanoi online — the classic disk-and-rod logic puzzle. Move the whole tower to another peg one disk at a time: only the top disk of a peg can move, and a bigger disk may never cover a smaller one. Choose 3 to 8 disks, drag or tap, and track your moves against the optimal 2ⁿ−1 target. Free in your browser, no download.

Play Tower of Hanoi

Three pegs start with all disks stacked on the left one, biggest at the bottom and smallest on top; the other two pegs are empty. Move a disk by dragging it onto another peg, or by tapping a peg to lift its top disk and then tapping the peg you want to drop it on. A move is legal only when the destination peg is empty or its top disk is bigger than the one you are moving; an illegal drop (a bigger disk landing on a smaller one) is rejected instantly and changes nothing. The fewest moves for n disks is 2^n − 1 — 3 disks take 7, 4 take 15, 5 take 31 — and the counter at the top tracks your moves against that optimum, upgrading to Perfect! when you solve it in the fewest. Undo steps back one move at a time. Pick 3 to 8 disks from the menu — bigger towers take far more moves — or add ?disks=5 to the page URL to jump straight to a specific tower. There is no timer; play at your own pace. Tip: to build a tower of n disks onto a peg, first build the n−1 tower on the spare peg, move the biggest disk across, then move the n−1 tower on top of it.

Loading game...

Objective: Move the entire tower from the left peg to either of the other pegs, one disk at a time. Two rules limit every move: you may only lift the top disk of a peg, and you may place a disk only on an empty peg or on top of a bigger disk — never on a smaller one. You win when every disk forms one complete tower on a peg other than the one it started on. Controls: Drag a disk to another peg with the mouse or your finger, or tap a peg to lift its top disk and tap another peg to drop it; the lifted disk rises and the peg under your pointer highlights as a drop target. Buttons: the disk-count menu (3 to 8), Undo, Rules and New game. A Solved! banner with a Play again button appears when you finish. Works with mouse and touch.

🎮 14 people have played · 19 games started

Can't play? Report a problem

If the game doesn't load, you canopen it in a new tab。

Source and license

The Tower of Hanoi is a public-domain mathematical puzzle published by Édouard Lucas in 1883, so there are no byte-reused upstream files. The rules module (js/hanoi.js), the page shell (js/main.js), the stylesheet, the analytics bridge and the touch shim are all Playnesta-original (MIT). The GUI layout is inspired by AJLoveChina/Hanoi @ 917b8d6 (MIT), an HTML/JS clone whose LICENSE was verified during sourcing (Copyright 2019 霸都丶傲天); it was read as a mechanism reference only and is not redistributed here. Playnesta Games is the developer and publisher of this specific web implementation. https://github.com/AJLoveChina/Hanoi · MIT

Game facts

Developer
Playnesta Games
Publisher
Playnesta Games
Genre
Puzzle, Logic

Playnesta guides

More free browser games on Playnesta — pick your next round.

Last verified 2026-10-14 12:30 UTC. Information can change; follow the linked source for the latest details.