Skip to content

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

Every move of the 4-disk solution
MoveDiskFromTo
11AB
22AC
31BC
43AB
51CA
62CB
71AB
84AC
91BC
102BA
111CA
123BC
131AB
142AC
151BC
On this page
  1. The solution
  2. The shape of the solution
  3. Which disk moves when
  4. The smallest disk's circuit
  5. About the 4-disk puzzle
  6. Other sizes
  7. Frequently asked questions

The shape of the solution

There are never 15 separate moves to remember — only three stages:

  1. Moves 1 to 7: build a tower of 3 disks on B.
  2. Move 8: disk 4 crosses to C — the only time it moves.
  3. 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.

DiskMovesFirst moves onThen every
18move 12 moves
24move 24 moves
32move 48 moves
41move 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

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.