Tower of Hanoi with 4 Disks
The shortest solution is 15 moves. Play them on the board, or read every one in the list under it.
Optimal solution
15moves2⁴ − 1
- First move
- Disk 1, A → B
- At one move a second
- 15 seconds
- Difficulty
- Easy
4 disks on tower A. 15 moves to go.Step 0 of 15
| Move | Disk | From | To |
|---|---|---|---|
| 1 | 1 | A | B |
| 2 | 2 | A | C |
| 3 | 1 | B | C |
| 4 | 3 | A | B |
| 5 | 1 | C | A |
| 6 | 2 | C | B |
| 7 | 1 | A | B |
| 8 | 4 | A | C |
| 9 | 1 | B | C |
| 10 | 2 | B | A |
| 11 | 1 | C | A |
| 12 | 3 | B | C |
| 13 | 1 | A | B |
| 14 | 2 | A | C |
| 15 | 1 | B | C |
On this page
The shape of the solution
There are never 15 separate moves to remember — only three stages:
- Moves 1 to 7: build a tower of 3 disks on B.
- Move 8: disk 4 crosses to C — the only time it moves.
- Moves 9 to 15: rebuild the 3-disk tower on top of it.
Stages 1 and 3 are each the 3-disk solution, with two towers' names swapped.
Which disk moves when
Disk 1 makes half of all the moves — 8 of them, on every odd-numbered move. Each larger disk moves half as often as the one above it, which is the binary counter hiding inside the puzzle: the disk that moves is one more than the number of times you can halve the move number and still get a whole number. Move 6 halves once, to 3, so move 6 is disk 2. There is more on that in Tower of Hanoi and binary.
| Disk | Moves | First moves on | Then every |
|---|---|---|---|
| 1 | 8 | move 1 | 2 moves |
| 2 | 4 | move 2 | 4 moves |
| 3 | 2 | move 4 | 8 moves |
| 4 | 1 | move 8 | — |
The smallest disk's circuit
With 4 disks — an even number — disk 1 travels A → B → C → A for the whole game, never reversing. Every move in between is the only legal move that leaves disk 1 alone. Those two rules alone reproduce the list above move for move; the iterative solution explains why, and strategies turns it into something to play by.
About the 4-disk puzzle
Four disks is where people who learned on three get caught out. The first move is no longer disk 1 to C: with an even number of disks it goes to B, and the smallest disk’s whole circuit turns round — A, B, C instead of A, C, B. Play four disks the way you played three and the three-disk tower gets built on C, which is the one tower the largest disk needs empty.
The way through is to think one level up. Fifteen moves is the three-disk solution played onto the spare tower, a single move for disk 4, and the three-disk solution again on top: 7 + 1 + 7. The first seven rows of the list are the three-disk solution with B and C swapped, move for move — put the two lists side by side and check.
Fifteen is also the first move count in the sequence that is composite: 3 × 5. Five disks brings a prime back.
Other sizes
- 3 disks7 moves — the solution that makes up each half of this one.
- 5 disks31 moves — this solution twice, with one move between.
- Solve 4 disks from a position you are stuck inThe solver finishes a half-played game in the fewest moves left, rather than starting again.
- Every solution, from 3 to 10 disksMove counts, first moves and timings side by side.
Frequently asked questions
How many moves does it take to solve Tower of Hanoi with 4 disks?
15 moves is the minimum: 2⁴ − 1 = 15. No solution with fewer moves exists, and any solution with more has wasted some.
What is the first move in 4-disk Tower of Hanoi?
Move disk 1, the smallest, from tower A to tower B. With an even number of disks the smallest disk travels A → B → C → A for the whole game, so its first stop is B. Sending it to C first still lets you finish, but it costs one extra move.
How long does 4-disk Tower of Hanoi take to solve?
A perfect game is 15 moves, which at one move a second is 15 seconds and at three moves a second — about as fast as anyone plays by hand — 5 seconds.
Why does the first move change with 4 disks?
Because the smallest disk circles the towers in opposite directions for odd and even numbers of disks. With four, the three disks above the largest have to end up on B, so the smallest disk must start by going to B, not C. Starting it towards C, as in the three-disk game, builds the three-disk tower on C — exactly where the largest disk needs to go.