Sokoban

Push boxes onto targets. You can push but never pull — so a position can become unwinnable without anything looking wrong.

You can push but never pull

That asymmetry is the whole game, and it has a consequence people find out the hard way: a position can become unwinnable without anything looking wrong. Push a box into a corner and it is stuck forever. Push one against a wall with no target anywhere along that wall and it can only slide uselessly up and down. Neither shows as an error — you simply carry on playing a level you can no longer finish.

This detects both of those and says so as soon as they happen. It cannot catch every deadlock, because deciding whether a Sokoban position is solvable at all is PSPACE-complete — genuinely, provably hard rather than merely awkward. So the honest position is that the obvious traps are flagged, subtler ones are not, and undo exists for the rest.

How to use

  1. Use the arrow keys or the buttons to walk.
  2. Walking into a box pushes it, if the square beyond is free.
  3. Get every box onto a target square.
  4. A box shown in red can never reach a target — undo.

Frequently asked questions

How do you play Sokoban?

You walk around a warehouse pushing boxes onto marked targets. You can only push, never pull, and only one box at a time — walking into a box moves it one square if the square beyond is empty. The level is finished when every box sits on a target.

Why can a Sokoban level become impossible?

Because pushing is one-way. Push a box into a corner and nothing can ever move it again; push one flat against a wall with no target along that wall and it can only slide uselessly back and forth. Nothing announces this — you simply carry on playing a level you can no longer finish.

What is a deadlock?

A position from which the level can no longer be solved, whatever you do next. The simplest is a box in a corner. The next simplest is a box on a wall with no target on that wall. More subtle ones involve two or more boxes blocking each other in ways that are difficult to spot and difficult to detect automatically.

Does this game detect deadlocks?

The two obvious kinds, yes — corner deadlocks and boxes stranded on targetless walls are marked in red the moment they happen. It cannot catch every one, because deciding whether a Sokoban position is solvable at all is PSPACE-complete, which is a genuinely hard computational problem rather than merely an awkward one.

What does PSPACE-complete mean here?

That Sokoban is among the hardest problems solvable with a reasonable amount of memory, and almost certainly harder than the problems usually called NP-complete. In practice it means no general solver will ever be fast on every level, and that hand-built levels can be genuinely difficult for machines as well as people.

What is a good general strategy?

Work out where each box has to end up before you push anything, and clear the boxes furthest from the exit path first. Think about which squares a box can still reach after each push, not just whether the push is legal. Most failed levels are lost several moves before they look lost.

Should I count moves or pushes?

Both are tracked, and the Sokoban community records them separately because they are different optimisation problems. A route with fewer pushes often needs far more walking, and level records are usually quoted as a pair rather than a single number.

Why is planning better than experimenting?

Because undo is the only way back and mistakes are silent. In most puzzle games a bad move is obvious immediately; in Sokoban a bad push can leave a position that looks completely healthy and is already lost. Thinking first genuinely costs less time than pushing first.

Where did Sokoban come from?

It was written by Hiroyuki Imabayashi in Japan in 1981 and published by Thinking Rabbit the following year. The name means warehouse keeper. It has been ported to essentially every platform since, and there are now tens of thousands of community-made levels.

Are the levels here original?

They are simple hand-built levels intended to teach the mechanics and the two common deadlocks, rather than the fiendish community sets that Sokoban is famous for. If you finish these easily, the large public level collections are where the real difficulty lives.

Can I undo a mistake?

Yes, as far back as your first move within a session. Given that a level can become quietly unwinnable, undo is less a convenience than part of how the game is meant to be played — and restarting is often faster than unwinding a long sequence.

Does the game save my progress?

No. Everything runs in your browser, nothing is stored or uploaded, and closing the tab loses the current position and your undo history.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.