Sokoban
Classic crate-pushing puzzle with 12 levels, undo and step-by-step replay
FAQ
Can I pull a crate back?
What if a level becomes unsolvable?
Where are the best scores kept?
How do I play on a phone?
How to use
- Pick a level
Tap a number chip to jump straight to any level, or step through with the prev and next buttons. The twelve levels are ordered from easy to tricky.
- Push the crates
Move with the arrow keys, WASD, the on-screen pad or a swipe on the board. Walking into a crate pushes it one square in that direction.
- Clear the board
The level is cleared when every crate sits on a target dot. The page tracks your move count and your push count while you work.
- Undo risky pushes
Undo takes back one step at a time. It also rolls back the move and push counters, so you can test a dangerous line safely.
- Beat your best
Your lowest move count per level is stored in the browser. Come back later and try to shave off a few more moves.
About this tool
Sokoban was created in Japan and first published in 1982, and it has been a fixture of the puzzle genre ever since. The rule fits in one sentence: push every crate onto a target spot. The catch is that a crate can only be pushed, never pulled. One careless step can wedge it into a corner and spoil the whole attempt. That single constraint turns a tiny grid into a genuine planning exercise. Scan the board first, decide where each crate should end up, and only then start moving. The twelve levels here begin with a three-move warm-up and build up to boards that need more than thirty careful steps. That keeps each round short but far from trivial.
This build keeps the focus on careful play. Every step lands on an undo stack, and undo also rolls back the move and push counters. That makes experimenting cheap, and mistakes never cost more than a few keystrokes. Your best move count for each level is saved in the browser and survives a refresh. That makes it easy to chase a shorter solution over several visits. The board is drawn with plain page elements and scales to the screen width. Keyboard play on a desktop and touch play on a phone both feel natural. Everything runs locally with no network requests and nothing to install.
How it works
From a computer science point of view, Sokoban is harder than most board games of its size. It belongs to the PSPACE-complete class, which means the cost of finding an optimal solution grows explosively as the board gets bigger. Practical solvers treat the player position and the set of crate positions as one search state. They run a breadth-first search over legal moves and prune branches where a crate ends up in a wall corner. The verification script for this page works exactly that way. It searches every level from scratch, confirms a solution, and reports optimal move and push benchmarks.
Level design is a craft of its own. Strong boards often use only two or three crates yet demand a precise order of handling. A single wrong push can make the rest unsolvable. Designers frequently work backwards from the finished position, pulling crates off their targets one at a time. They check that each step has a legal pushing stance, then add walls and corridors to hide the idea. Every map on this page stays within ten columns, small enough to read at a glance on a phone. Most rounds finish in a few minutes.
When to use it
- Short sessions
The boards are small and the rounds are quick. A queue or a coffee break is long enough for a level or two. Progress and per-level bests stay in the browser, so you can close the tab whenever you like and pick the challenge back up later.
- Playing with kids
The rule takes one sentence to explain, and the first few levels warm up gently. Racing someone to the lowest move count turns a quiet puzzle into a friendly contest for kids. Undo keeps an early mistake from turning into tears.
- A mental reset
There is no timer and no penalty for pausing, so the game works well as a short break between tasks. Levels usually have several solutions, and hunting a shorter route for a board you already solved gives the break a small, satisfying goal.
Tips & tricks
- Count the crates and the dots first, then plan a route and an order for each crate.
- A crate against a wall can only slide along it, so treat wall runs as one-way streets.
- Push order matters. Sometimes crate A has to move first to open the lane for crate B.
- Pushes and moves are counted separately, and one long clean push usually beats back-and-forth shuffling.
Things to watch
- Crate in a corner
A crate pushed into a corner or onto a dead square beside a wall can never be moved again. Undo is the only way back, so check where a crate will come to rest before you commit to the push.
- Fixating on one step
Watching only the next square often leaves a crate on the wrong side of its target. Correcting that costs many extra moves. Glance at the target direction before every push. It is the most common way to make an easy board hard.
- Inflated move counts
A stray key press adds moves even when it leads nowhere, and the best record only shrinks with clean runs. Undo a wrong step right away instead of resetting the whole level. The counter reflects exactly what you did, so tidy play pays off twice.