Play Klotski Online: the Classic Sliding Block Puzzle

Klotski is the sliding-block puzzle known in China as Huarong Road (华容道): slide the generals and soldiers aside until Cao Cao, the big 2×2 block, reaches the exit at the bottom of the tray. One piece sliding any distance, even around a corner, is one move — the classic Heng Dao Li Ma layout takes 81. 64 levels from 3 moves to the hardest possible 138, 28 traditional named layouts, a daily puzzle, and a hint that shows the next move without making it. Play Klotski free in your browser — no download, no account.

Why play Klotski here?

Every level's fewest-moves number is the exact minimum, computed by searching every position the ten pieces can take — so gold means you found a shortest solution. The hint lights up the next move from wherever you are and leaves the moving to you, and the counting rule is on the page: one piece sliding any distance, corners included, is one move. Show the solution solves the board from wherever you are and plays a shortest line move by move, and past the 64 levels and the daily, Endless deals from over 8,500 more puzzles sorted by fewest moves — no two of them the same puzzle a few moves in.

How You WinBring Cao Cao, the 2×2 block, to the two middle squares of the bottom row, right above the exit. The game counts your moves; every level shows the fewest moves it can be done in, and matching that earns gold.

Tray
4 × 5 squares, exit in the bottom middle
Pieces
1 big, 5 long, 4 small, 2 gaps
Classic
Heng Dao Li Ma: 81 moves

How to play Klotski in one minute

  1. The big red block is Cao Cao. Get him to the gap in the middle of the bottom edge: the puzzle is solved when he stands right above it.
  2. Drag a piece into the empty squares — it can slide as far as it likes and turn corners. Or tap it: one place to go and it goes, several and they light up for you to choose.
  3. One piece sliding, however far, is one move. The count sits above the tray next to the fewest moves possible; match that number for gold.
  4. Stuck? Hint lights up the next move of a shortest solution without making it. Undo takes back a whole move; Show the solution plays the rest from where you are.
  5. Levels run from 3 moves to 138 in five chapters, including the classic layouts such as Heng Dao Li Ma (81). The Daily puzzle is the same for everyone each day, and Endless deals from over 8,500 more by fewest moves.

Level 1 walks you through its three moves the first time you play. On a phone the hint, undo and restart buttons are in the bottom bar, and the level button at its left opens the level list.

Playing Klotski here: common questions

Is Klotski here free, and do I need to download anything?

It is free, with no download, no account and no ads. It runs in any phone or desktop browser, and a puzzle you leave half-done is still there when you come back in the same browser.

Is this the same as the numbered sliding puzzle?

No. The numbered one (the 15 puzzle) has square tiles to put back in order. Klotski has ten pieces of four sizes and a single goal: get the big 2×2 block, Cao Cao, out through the gap in the bottom edge. It is also called Huarong Road, after the story it comes from.

Why does this site say 81 moves when another says 90 or 116?

They count differently. Here one piece sliding any distance, even around a corner, is one move, which gives the well-known 81 for Heng Dao Li Ma. Counting every square gives 116, and counting only straight slides gives 90. The square count is shown too when you finish.

Which classic layouts can I play, and how many moves do they take?

The Classic layouts chapter has 28 traditional named layouts and Master has 6 more, each solved again under this counting. Heng Dao Li Ma (Blade Drawn, Horse Reined) takes 81, Calm Command 70, Three-Pronged March 72, Five Generals at the Gate 36, and the longest, Winding Mountain Path, 138.

Can I play Klotski on my phone?

Yes. The tray fills the width of the screen and you can drag pieces or tap them. The hint, undo and restart buttons sit in the bottom bar, and the level button at its left opens the level list.

What a game looks like

  • Every puzzle uses the same ten pieces: Cao Cao (2×2), five generals (1×2, standing or lying on their side) and four soldiers (1×1), with two empty squares.
  • The levels come in five chapters: Beginner, Medium and Advanced run from 3 to 70 moves; Classic layouts holds 28 of the traditional named layouts; Master ends with the 138-move puzzle.
  • The daily puzzle is the same for everyone on a date. Monday and Tuesday are the gentlest, Wednesday to Friday are in the middle, and the weekend is the hardest.
  • Endless deals from over 8,500 further puzzles, grouped by fewest moves in bands of ten.

Complete Rules

  • A piece can only slide into empty squares, up, down, left or right. It never jumps, turns around or leaves the tray, and it never passes through another piece.
  • One move is one piece's slide through empty squares, however far and however many corners it turns. The same piece moving again right after is part of the same move; sliding it back to where that move started takes the move away.
  • The puzzle is solved the moment Cao Cao's 2×2 block covers the two middle squares of the bottom two rows, right above the exit. Cao Cao then walks out; that last step is not counted.
  • Undo takes back one whole move, as many times as you like. Restart puts every piece back where it began and the count back to zero.
  • Medals: gold for the fewest moves, silver for no more than a quarter over, and plain "solved" otherwise. A game that used a hint or showed the solution is solved but earns no medal and does not replace your best.
  • Your progress, medals and the game in progress are kept in this browser. There is no account and no leaderboard.

Your First Game

  • Look at the two empty squares first. Every move uses them, so the question is always which piece can go into the gap and where the gap goes next.
  • Cao Cao needs a two-square-wide gap to move at all. Most of the work is lining up the two empty squares side by side, or one above the other, next to him.
  • Soldiers are the small change of the puzzle. Moving a soldier round a corner in one move is often how the gap gets from one side of the tray to the other.
  • A lying general (the long block across two columns) is the usual obstacle under Cao Cao. Getting it out of his way is the first real goal of the classic layout.
  • When you are stuck, undo a few moves rather than pushing on. The fewest-moves number tells you how far you are from the best line.

Practical Strategy

  • Work backwards from the exit: Cao Cao ends in the bottom middle, so the pieces there now have to end up somewhere else. Decide where before you start.
  • Keep the two gaps together. Two separate gaps can each move only a soldier; together they let a general or Cao Cao through.
  • Count a long slide as the bargain it is. Sliding one piece around a corner costs one move here, so routes that let one piece travel far are cheaper than several short moves of different pieces.
  • In the classic layouts the first half of the solution usually moves Cao Cao to one side so the lying general can come up past him. Learn that pattern once and many named layouts open up.
  • Use the hint as a check, not a crutch: take one hint, then try to see why that move shortens the solution before taking another.

Winning and Special Rules

  • Named layouts. Heng Dao Li Ma (81 moves) is the classic opening. Other traditional layouts have names too, such as Bing Fen San Lu (72) and Feng Hui Lu Zhuan (138). Old books and apps disagree about some names and step counts; every count here was computed again under the one counting rule above.
  • Hint and solution. The hint shows the next move of a shortest solution from your position; the solution plays that whole line. Both come from an exact search, so following them always reaches the goal in the fewest moves left.
  • Daily. One layout a day, picked from puzzles that have already been solved. Your best result for the day is kept, and you can share a one-line result.
  • Endless. Over 8,500 more puzzles, sorted by fewest moves in bands of ten (6 to 100, then everything longer). Pick a band and you get one you have not solved yet; Next deals another from the same band. No two are the same puzzle a few moves in.

Common Mistakes

  • Counting squares instead of moves. A soldier sliding two squares and round a corner is still one move; the square count is shown separately.
  • Filling the gaps with soldiers. Two soldiers side by side in the only gap can lock the whole bottom of the tray.
  • Chasing Cao Cao downwards too early. He usually has to go sideways or even up first so that the generals under him can get out of the way.
  • Comparing counts with other versions without checking their rule. Some count every square, some count only straight slides; the same layout can read 81, 90 or 116 depending on the rule.
  • Thinking a puzzle is impossible. Every puzzle here has been solved; if the fewest-moves number is high, the solution is long, not missing.

Klotski FAQ

What counts as one move?

One piece sliding as far as it likes through empty squares, even around a corner, is one move. Moving the same piece again straight away still counts as that same move; touching a different piece starts a new one. This is the counting behind the famous "81 moves" for the classic layout. The result card also shows the number of squares travelled.

How do I move a piece?

Drag it: it follows your finger through the empty squares and can turn corners. Or tap it: if it has only one place to go it goes there, and if it has several they light up and you tap the one you want.

Is every level solvable?

Yes. Every level, daily puzzle and Endless puzzle was solved by computer, and the number shown as "fewest" is the exact minimum under this move counting — not an estimate and not copied from anywhere. The hardest layout that exists for this set of pieces takes 138 moves; it is the last level of the Master chapter.

Is there a solver? How do the hint and the solution work?

Yes, built in. Hint solves the board from exactly where you are and lights up the next move of a shortest solution: the piece glows and a blue outline shows where it goes, and you make the move. Show the solution also works from your position and plays the rest of the shortest line one move at a time; tap the board to take over. Hint works on every puzzle; Show the solution works on every level and Endless puzzle but not the daily, which everyone plays and shares. Using either means no medal for that puzzle this time. You cannot type in a position of your own to solve.

Klotski board