Tower of Hanoi with 8 Disks
The shortest solution is 255 moves. Play them on the board, or read every one in the list under it.
Optimal solution
255moves2⁸ − 1
- First move
- Disk 1, A → B
- At one move a second
- 4 minutes
- Difficulty
- Hard
8 disks on tower A. 255 moves to go.Step 0 of 255
| 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 |
| 16 | 5 | A | B |
| 17 | 1 | C | A |
| 18 | 2 | C | B |
| 19 | 1 | A | B |
| 20 | 3 | C | A |
| 21 | 1 | B | C |
| 22 | 2 | B | A |
| 23 | 1 | C | A |
| 24 | 4 | C | B |
| 25 | 1 | A | B |
| 26 | 2 | A | C |
| 27 | 1 | B | C |
| 28 | 3 | A | B |
| 29 | 1 | C | A |
| 30 | 2 | C | B |
| 31 | 1 | A | B |
| 32 | 6 | A | C |
| 33 | 1 | B | C |
| 34 | 2 | B | A |
| 35 | 1 | C | A |
| 36 | 3 | B | C |
| 37 | 1 | A | B |
| 38 | 2 | A | C |
| 39 | 1 | B | C |
| 40 | 4 | B | A |
| 41 | 1 | C | A |
| 42 | 2 | C | B |
| 43 | 1 | A | B |
| 44 | 3 | C | A |
| 45 | 1 | B | C |
| 46 | 2 | B | A |
| 47 | 1 | C | A |
| 48 | 5 | B | C |
| 49 | 1 | A | B |
| 50 | 2 | A | C |
| 51 | 1 | B | C |
| 52 | 3 | A | B |
| 53 | 1 | C | A |
| 54 | 2 | C | B |
| 55 | 1 | A | B |
| 56 | 4 | A | C |
| 57 | 1 | B | C |
| 58 | 2 | B | A |
| 59 | 1 | C | A |
| 60 | 3 | B | C |
| 61 | 1 | A | B |
| 62 | 2 | A | C |
| 63 | 1 | B | C |
| 64 | 7 | A | B |
| 65 | 1 | C | A |
| 66 | 2 | C | B |
| 67 | 1 | A | B |
| 68 | 3 | C | A |
| 69 | 1 | B | C |
| 70 | 2 | B | A |
| 71 | 1 | C | A |
| 72 | 4 | C | B |
| 73 | 1 | A | B |
| 74 | 2 | A | C |
| 75 | 1 | B | C |
| 76 | 3 | A | B |
| 77 | 1 | C | A |
| 78 | 2 | C | B |
| 79 | 1 | A | B |
| 80 | 5 | C | A |
| 81 | 1 | B | C |
| 82 | 2 | B | A |
| 83 | 1 | C | A |
| 84 | 3 | B | C |
| 85 | 1 | A | B |
| 86 | 2 | A | C |
| 87 | 1 | B | C |
| 88 | 4 | B | A |
| 89 | 1 | C | A |
| 90 | 2 | C | B |
| 91 | 1 | A | B |
| 92 | 3 | C | A |
| 93 | 1 | B | C |
| 94 | 2 | B | A |
| 95 | 1 | C | A |
| 96 | 6 | C | B |
| 97 | 1 | A | B |
| 98 | 2 | A | C |
| 99 | 1 | B | C |
| 100 | 3 | A | B |
| 101 | 1 | C | A |
| 102 | 2 | C | B |
| 103 | 1 | A | B |
| 104 | 4 | A | C |
| 105 | 1 | B | C |
| 106 | 2 | B | A |
| 107 | 1 | C | A |
| 108 | 3 | B | C |
| 109 | 1 | A | B |
| 110 | 2 | A | C |
| 111 | 1 | B | C |
| 112 | 5 | A | B |
| 113 | 1 | C | A |
| 114 | 2 | C | B |
| 115 | 1 | A | B |
| 116 | 3 | C | A |
| 117 | 1 | B | C |
| 118 | 2 | B | A |
| 119 | 1 | C | A |
| 120 | 4 | C | B |
| 121 | 1 | A | B |
| 122 | 2 | A | C |
| 123 | 1 | B | C |
| 124 | 3 | A | B |
| 125 | 1 | C | A |
| 126 | 2 | C | B |
| 127 | 1 | A | B |
| 128 | 8 | A | C |
| 129 | 1 | B | C |
| 130 | 2 | B | A |
| 131 | 1 | C | A |
| 132 | 3 | B | C |
| 133 | 1 | A | B |
| 134 | 2 | A | C |
| 135 | 1 | B | C |
| 136 | 4 | B | A |
| 137 | 1 | C | A |
| 138 | 2 | C | B |
| 139 | 1 | A | B |
| 140 | 3 | C | A |
| 141 | 1 | B | C |
| 142 | 2 | B | A |
| 143 | 1 | C | A |
| 144 | 5 | B | C |
| 145 | 1 | A | B |
| 146 | 2 | A | C |
| 147 | 1 | B | C |
| 148 | 3 | A | B |
| 149 | 1 | C | A |
| 150 | 2 | C | B |
| 151 | 1 | A | B |
| 152 | 4 | A | C |
| 153 | 1 | B | C |
| 154 | 2 | B | A |
| 155 | 1 | C | A |
| 156 | 3 | B | C |
| 157 | 1 | A | B |
| 158 | 2 | A | C |
| 159 | 1 | B | C |
| 160 | 6 | B | A |
| 161 | 1 | C | A |
| 162 | 2 | C | B |
| 163 | 1 | A | B |
| 164 | 3 | C | A |
| 165 | 1 | B | C |
| 166 | 2 | B | A |
| 167 | 1 | C | A |
| 168 | 4 | C | B |
| 169 | 1 | A | B |
| 170 | 2 | A | C |
| 171 | 1 | B | C |
| 172 | 3 | A | B |
| 173 | 1 | C | A |
| 174 | 2 | C | B |
| 175 | 1 | A | B |
| 176 | 5 | C | A |
| 177 | 1 | B | C |
| 178 | 2 | B | A |
| 179 | 1 | C | A |
| 180 | 3 | B | C |
| 181 | 1 | A | B |
| 182 | 2 | A | C |
| 183 | 1 | B | C |
| 184 | 4 | B | A |
| 185 | 1 | C | A |
| 186 | 2 | C | B |
| 187 | 1 | A | B |
| 188 | 3 | C | A |
| 189 | 1 | B | C |
| 190 | 2 | B | A |
| 191 | 1 | C | A |
| 192 | 7 | B | C |
| 193 | 1 | A | B |
| 194 | 2 | A | C |
| 195 | 1 | B | C |
| 196 | 3 | A | B |
| 197 | 1 | C | A |
| 198 | 2 | C | B |
| 199 | 1 | A | B |
| 200 | 4 | A | C |
| 201 | 1 | B | C |
| 202 | 2 | B | A |
| 203 | 1 | C | A |
| 204 | 3 | B | C |
| 205 | 1 | A | B |
| 206 | 2 | A | C |
| 207 | 1 | B | C |
| 208 | 5 | A | B |
| 209 | 1 | C | A |
| 210 | 2 | C | B |
| 211 | 1 | A | B |
| 212 | 3 | C | A |
| 213 | 1 | B | C |
| 214 | 2 | B | A |
| 215 | 1 | C | A |
| 216 | 4 | C | B |
| 217 | 1 | A | B |
| 218 | 2 | A | C |
| 219 | 1 | B | C |
| 220 | 3 | A | B |
| 221 | 1 | C | A |
| 222 | 2 | C | B |
| 223 | 1 | A | B |
| 224 | 6 | A | C |
| 225 | 1 | B | C |
| 226 | 2 | B | A |
| 227 | 1 | C | A |
| 228 | 3 | B | C |
| 229 | 1 | A | B |
| 230 | 2 | A | C |
| 231 | 1 | B | C |
| 232 | 4 | B | A |
| 233 | 1 | C | A |
| 234 | 2 | C | B |
| 235 | 1 | A | B |
| 236 | 3 | C | A |
| 237 | 1 | B | C |
| 238 | 2 | B | A |
| 239 | 1 | C | A |
| 240 | 5 | B | C |
| 241 | 1 | A | B |
| 242 | 2 | A | C |
| 243 | 1 | B | C |
| 244 | 3 | A | B |
| 245 | 1 | C | A |
| 246 | 2 | C | B |
| 247 | 1 | A | B |
| 248 | 4 | A | C |
| 249 | 1 | B | C |
| 250 | 2 | B | A |
| 251 | 1 | C | A |
| 252 | 3 | B | C |
| 253 | 1 | A | B |
| 254 | 2 | A | C |
| 255 | 1 | B | C |
On this page
The shape of the solution
There are never 255 separate moves to remember — only three stages:
- Moves 1 to 127: build a tower of 7 disks on B.
- Move 128: disk 8 crosses to C — the only time it moves.
- Moves 129 to 255: rebuild the 7-disk tower on top of it.
Stages 1 and 3 are each the 7-disk solution, with two towers' names swapped.
Which disk moves when
Disk 1 makes half of all the moves — 128 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 | 128 | move 1 | 2 moves |
| 2 | 64 | move 2 | 4 moves |
| 3 | 32 | move 4 | 8 moves |
| 4 | 16 | move 8 | 16 moves |
| 5 | 8 | move 16 | 32 moves |
| 6 | 4 | move 32 | 64 moves |
| 7 | 2 | move 64 | 128 moves |
| 8 | 1 | move 128 | — |
The smallest disk's circuit
With 8 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 8-disk puzzle
Eight disks is the original. When Édouard Lucas put the puzzle on sale in 1883 as La Tour d’Hanoï, the tower in the box had eight wooden disks, so a perfect game of the first Tower of Hanoi anyone bought took 255 moves — the number on this page. The sixty-four golden disks came later, in the legend written up for it; the eight wooden ones are what people actually played. There is more in the history of the puzzle.
255 in binary is 11111111: eight ones, one for each disk, and the largest value a single byte can hold. The match is not a coincidence of this size. Count the moves in binary from 1 to 255 and, on every move, the disk that moves is the position of the lowest 1 bit — so the whole solution is a byte counting up. Tower of Hanoi and binary plays that counter beside a board.
Eight is even, so disk 1 starts toward B. The count factors as 3 × 5 × 17, and the game is Hard on this board, a little over four minutes at a move a second.
Other sizes
- 7 disks127 moves — the solution that makes up each half of this one.
- 9 disks511 moves — this solution twice, with one move between.
- Solve 8 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 8 disks?
255 moves is the minimum: 2⁸ − 1 = 255. No solution with fewer moves exists, and any solution with more has wasted some.
What is the first move in 8-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 8-disk Tower of Hanoi take to solve?
A perfect game is 255 moves, which at one move a second is 4 minutes and at three moves a second — about as fast as anyone plays by hand — 1 minute.
How many disks did the original Tower of Hanoi have?
Eight. The puzzle Édouard Lucas sold in 1883 as La Tour d'Hanoï was a tower of eight wooden disks on three pegs, so a perfect game of the original took 255 moves. The legend published about it a year later described sixty-four disks of gold, but nobody was ever sold those.