Sliding Puzzle

Fifteen numbered tiles and one empty square to move them into. Slide them one at a time until the numbers run back in order, and beat the clock while you are at it — the last two are always the awkward ones.

How to play

Only the tiles touching the empty square can move, so in practice you are steering the gap around the board and letting tiles drop into it.

  1. Tap a tile next to the gap It slides into the space. Tiles that are not touching the gap cannot move.
  2. Or use the arrow keys The arrows move a tile into the gap in that direction.
  3. Solve the top row first Get row one finished, then leave it alone and work on row two.
Full instructions
In depth

Solving the sliding tile puzzle the right way

Why working row by row beats chasing numbers, how the scramble guarantees every board is solvable, the technique for placing the last two tiles in a row, and what changes on the larger grids.

Screenshot: How to play the sliding puzzle
How to play the sliding puzzle as it appears when the page opens.

The puzzle and its goal

A grid of numbered tiles sits in a frame with one empty space. You can slide any tile that is next to the empty space into it, one tile at a time. The goal is to put every tile back in order, left to right and top to bottom, with the empty space in the bottom-right corner, before the clock runs out.

This is the classic sliding puzzle, and it has been around since the 1870s. The version here offers three grid sizes and a countdown timer that adds urgency without changing the puzzle itself.

Rules and controls

Only tiles next to the empty space can move. Tap or click a tile that shares an edge with the gap and it slides into the space. On a keyboard, use the arrow keys. The arrows move a tile into the gap in the direction you press, so pressing up brings the tile below the gap upward.

Tiles already in their correct position turn green. This gives you a visual marker for progress. It also warns you when a move accidentally pushes a solved tile out of its place.

Grid sizes and time limits

The Level dropdown offers three sizes. Easy is a three-by-three grid with eight tiles and a two-minute timer. Normal is the classic four-by-four grid with fifteen tiles and four minutes. Hard is a five-by-five grid with twenty-four tiles and seven minutes.

The three-by-three board is small enough to solve by instinct. The four-by-four board is where the row-by-row method starts to matter. The five-by-five board uses exactly the same technique but demands more patience because each row and column has more tiles to arrange.

Every scramble can be solved

The board is scrambled by making many random legal moves starting from the solved position. That is an important detail. If you were to take all the tiles out and put them back in a random order, exactly half of all possible arrangements would be impossible to solve. No sequence of slides could ever reach the solved state from those positions.

By working backward from solved, the scramble guarantees that a path back to the solution exists. You are never handed a board that cannot be finished. The scramble also avoids stepping back to where it just came from, so the board is always genuinely mixed up rather than nearly solved.

Strategy: solve the outside first

The most common mistake is trying to place tiles in numerical order. Putting tile 1 in place, then tile 2, then tile 3 sounds logical, but every time you work on a later tile you disturb the earlier ones. The board fights you at every step.

The method that works is to solve the top row first, then the left column, then repeat on the smaller rectangle that remains. Once a row or column is finished, never touch it again. You are reducing the problem at each step. A five-by-five grid becomes a four-by-four, then a three-by-three, and so on.

On the four-by-four board, solve the top row of four tiles. Then solve the left column of the remaining three-by-three section. Now you have a two-by-three rectangle to finish, which takes only a minute once you have the feel.

Strategy: the last two tiles in a row

The hardest part of any row is placing the final two tiles. Suppose you are finishing the top row and tiles 3 and 4 need to go into the last two cells. If you slide 3 into place first, there is no way to move 4 into the last cell without pushing 3 out.

The standard technique is to stack both tiles vertically before rotating them into place together. Get tile 4 directly above tile 3 in the column where tile 3 belongs. Then rotate the group so both tiles drop into the top row at the same time. This rotation is a pattern you learn once and use every time. It works the same way for the last two tiles of any row or column.

Once you know this trick, the puzzle stops feeling random. Every row and column follows the same sequence: place the early tiles by maneuvering the gap around them, then use the rotation to lock in the final pair.

Strategy: use the green tiles as guardrails

A tile turns green the moment it reaches its correct position. Those green markers serve two purposes. They show you at a glance how much of the board is already solved. More importantly, they warn you the instant a move pushes a finished tile out of place.

While working on a row, glance at the green tiles in the rows above it. If one disappears, you have disturbed your earlier work and need to undo the last few moves. On larger boards this awareness saves time, because losing a finished row and rebuilding it is the most expensive mistake you can make.

The endgame: the last two-by-two block

After the top rows and left columns are solved, you are left with a small block of tiles in the bottom-right corner. On a four-by-four board this is a two-by-two area with three tiles and the gap. On a five-by-five board the remaining rectangle might be two-by-three before it shrinks to two-by-two.

The final two-by-two block has only three tiles and only two possible states: correct, or with two tiles swapped. If the tiles are swapped, there is a short rotation that fixes them. Slide one tile into the gap, push the other into the vacated spot, and rotate the third into place. The whole sequence is four or five moves.

If the two tiles seem stuck in the wrong order and no rotation fixes them, you have likely made an error in an earlier row. The two-by-two finish always works when the rest of the board is correct. Going back to check the last completed row is faster than spending moves trying to force a swap that cannot happen.

Common mistakes

  • Solving in numerical order. Chasing tile 1, then 2, then 3 across the whole board undoes your own work constantly. Solve by row and column instead.
  • Moving tiles randomly and hoping the board sorts itself out. The puzzle has too many arrangements for random sliding to converge. A method is needed.
  • Forgetting the timer. Each grid size has a fixed time limit. On the hard five-by-five board you have seven minutes, which is plenty if you use the row-by-row method but tight if you are improvising.
  • Breaking a finished row while working on the next one. Once a row is solved, every move you make should leave it intact. If you find yourself moving tiles from a solved row, stop and find a path that avoids them.
  • Not starting on the small board. The three-by-three grid teaches the rotation technique in a couple of minutes. Jumping straight to the four-by-four without that foundation turns a learnable puzzle into a guessing game.

Scoring

The stats bar shows three things. Moves counts every tile you slide. In place shows how many tiles are currently in their correct position out of the total. Time left is the countdown clock for the current grid size.

Fewer moves is a better score. The game records your best move count for each grid size in your browser. A solved board reports the move count and the remaining time. Running out of time before finishing ends the game and shows how many tiles were in place.

Everything stays on your device

The puzzle runs entirely in your browser. The scramble is computed on your machine, the timer ticks locally, and no data is sent to any server. Your best scores are stored in your browser on this device and do not travel elsewhere. Once the page has loaded, the game works offline. There is no account to create and nothing to sign in to. Close the tab and the only thing that stays is your best move count, tucked away in your browser's own storage.

Help

How to play the sliding puzzle

Only the tiles touching the empty square can move, so in practice you are steering the gap around the board and letting tiles drop into it. Work the top row first and keep what is finished out of the way; the last two tiles of a row have to be manoeuvred into place together rather than one at a time.

Tap a tile next to the gap

It slides into the space. Tiles that are not touching the gap cannot move.

Or use the arrow keys

The arrows move a tile into the gap in that direction.

Solve the top row first

Get row one finished, then leave it alone and work on row two.

Then the left column

Once the top row and left column are done, you are solving a smaller puzzle.

Finish before the clock

Green tiles are already in the right place, so you can see progress at a glance.

Runs on your device

The whole game is played inside this page. Nothing is uploaded, there is no account, and your best score is stored in this browser only. Once the page has loaded it works offline.

Good to know

Top row, then left column

Solve the outside and work inwards. Trying to place tiles in the order they are numbered will undo your own work constantly.

Every scramble can be solved

The board is jumbled by making random legal moves from the solved state. A genuinely shuffled board is unsolvable half the time.

The last two are a pattern

When two tiles in a finished row are the wrong way round, there is a standard rotation to fix it. Once you know it, the puzzle stops being frustrating.

Start on 3×3

The small board teaches the technique in a couple of minutes. The 5×5 uses exactly the same method with more patience.

Common questions

Is it free?
Yes — no account, no limit on how many games you play, and no ads inside the game area itself. Ads on the page around it pay for the site.
Does it work on a phone?
Yes. The board scales to your screen and the controls are made big enough to use with a thumb.
Is every puzzle solvable?
Yes. It is scrambled by making random legal moves backwards from solved, so it can always be undone. Exactly half of all possible arrangements of a 15 puzzle are impossible, which is why shuffling would be wrong.
What order should I solve it in?
Top row first, then the left column, then repeat on what is left. Solving strictly in number order means constantly disturbing what you have done.
What do the green tiles mean?
That tile is already in its final position.
Where is my best score kept?
In your browser on this device. It is never sent anywhere and will not follow you to another computer.