Klotski solution

Klotski solution in 81 moves

The classic klotski layout solved in the fewest possible moves, computed by our own search. Press play or step through it, then try it yourself in the klotski game.

Move 0 / 81

Start position

About this solution

  • Length: 81 moves, where one block moved any distance counts as one move. Straight slides only: 90. Square by square: 116 at best.
  • The big block moves 9 times; its first move is move 26. Everything before that is making room.
  • 9 of the 81 moves slide a block around a corner, which is why the straight-slide count is higher.
  • This route travels 118 squares in total. Counting square by square, the shortest possible route is 116 squares — a different route, optimised for a different ruler.

Milestones

Five snapshots of the same route. If you lose your way while following along, compare your board with the nearest one.

All 81 moves

Columns A–D run left to right, rows 1–5 top to bottom; squares name a block’s top-left corner. Tap a move to show that position in the player above.

  1. 1.Small block B4 → B5 (down)
  2. 2.Small block D5 → C5 (left)
  3. 3.Tall block D3 → D4 (down)
  4. 4.Wide block B3 → C3 (right)
  5. 5.Tall block A3 → B3 (right)
  6. 6.Small block A5 → A4 (up)
  7. 7.Small block B5 → A5 (left)
  8. 8.Tall block B3 → B4 (down)
  9. 9.Wide block C3 → A3 (left 2)
  10. 10.Small block C4 → D3 (up, right)
  11. 11.Small block C5 → C3 (up 2)
  12. 12.Tall block B4 → C4 (right)
  13. 13.Small block A4 → B5 (right, down)
  14. 14.Wide block A3 → A4 (down)
  15. 15.Small block C3 → A3 (left 2)
  16. 16.Small block D3 → B3 (left 2)
  17. 17.Tall block C4 → C3 (up)
  18. 18.Tall block D4 → D3 (up)
  19. 19.Small block B5 → D5 (right 2)
  20. 20.Small block A5 → C5 (right 2)
  21. 21.Wide block A4 → A5 (down)
  22. 22.Small block B3 → A4 (down, left)
  23. 23.Tall block C3 → B3 (left)
  24. 24.Tall block D3 → C3 (left)
  25. 25.Tall block D1 → D3 (down 2)
  26. 26.Big block B1 → C1 (right)
  27. 27.Tall block A1 → B1 (right)
  28. 28.Small block A3 → A1 (up 2)
  29. 29.Small block A4 → A2 (up 2)
  30. 30.Tall block B3 → A3 (left)
  31. 31.Tall block B1 → B3 (down 2)
  32. 32.Big block C1 → B1 (left)
  33. 33.Tall block D3 → D1 (up 2)
  34. 34.Tall block C3 → D3 (right)
  35. 35.Small block C5 → C3 (up 2)
  36. 36.Small block D5 → C4 (left, up)
  37. 37.Wide block A5 → C5 (right 2)
  38. 38.Tall block B3 → B4 (down)
  39. 39.Tall block A3 → A4 (down)
  40. 40.Small block C3 → A3 (left 2)
  41. 41.Big block B1 → B2 (down)
  42. 42.Small block A1 → C1 (right 2)
  43. 43.Small block A2 → B1 (up, right)
  44. 44.Small block A3 → A1 (up 2)
  45. 45.Tall block A4 → A2 (up 2)
  46. 46.Tall block B4 → A4 (left)
  47. 47.Small block C4 → B5 (left, down)
  48. 48.Big block B2 → B3 (down)
  49. 49.Small block C1 → B2 (down, left)
  50. 50.Tall block D1 → C1 (left)
  51. 51.Tall block D3 → D1 (up 2)
  52. 52.Big block B3 → C3 (right)
  53. 53.Small block B2 → B3 (down)
  54. 54.Small block B1 → B2 (down)
  55. 55.Small block A1 → B1 (right)
  56. 56.Tall block A2 → A1 (up)
  57. 57.Tall block A4 → A3 (up)
  58. 58.Small block B5 → A5 (left)
  59. 59.Small block B3 → B5 (down 2)
  60. 60.Big block C3 → B3 (left)
  61. 61.Tall block D1 → D3 (down 2)
  62. 62.Tall block C1 → D1 (right)
  63. 63.Small block B1 → C1 (right)
  64. 64.Small block B2 → C2 (right)
  65. 65.Tall block A1 → B1 (right)
  66. 66.Tall block A3 → A1 (up 2)
  67. 67.Big block B3 → A3 (left)
  68. 68.Small block C2 → C4 (down 2)
  69. 69.Small block C1 → C3 (down 2)
  70. 70.Tall block D1 → C1 (left)
  71. 71.Tall block D3 → D1 (up 2)
  72. 72.Small block C4 → D3 (right, up)
  73. 73.Wide block C5 → C4 (up)
  74. 74.Small block B5 → D5 (right 2)
  75. 75.Small block A5 → C5 (right 2)
  76. 76.Big block A3 → A4 (down)
  77. 77.Small block C3 → A3 (left 2)
  78. 78.Small block D3 → B3 (left 2)
  79. 79.Wide block C4 → C3 (up)
  80. 80.Small block C5 → D4 (up, right)
  81. 81.Big block A4 → B4 (right)

How we found it

Breadth-first search explores positions in order of distance from the start: first every position one move away, then two, and so on. Blocks of the same shape are treated as identical, which keeps the number of positions small. The first time the search reaches a position with the big block at the exit, the route to it is a shortest one. For this layout that happened at depth 81, after 23,845 positions. The same code computes the fewest-moves column for every level in our klotski and sliding block games.

FAQ

What is the shortest klotski solution?

81 moves for the classic layout, counting one block moved any distance (even around a corner) as one move. Our breadth-first search looked at 23,845 positions before reaching the first solved one, which proves nothing shorter exists.

Why do some sites say 116 or 90 moves?

They count differently. If every straight slide is a move, the minimum is 90; if every square is a move, it is 116. Same puzzle, different ruler.

Is this the only shortest solution?

No. Blocks of the same shape are interchangeable and many moves can be swapped in order, so there are many routes of the same length. This page shows one of them.

How do I read the notation?

Columns are A to D from left to right and rows 1 to 5 from top to bottom. Each move gives the block, the square of its top-left corner before and after, and the directions it slid.

Can I try it myself?

Yes. Open the klotski game, pick the classic layout and follow along, or play without help and compare your move count with this one.