How to play Sliding Puzzle

A square board holds one tile fewer than it has places. Slide tiles into the gap until they run 1, 2, 3 and on, and you win. That one line is the whole rule. But try it and the tiles you have already placed keep coming apart again, which is maddening. What this page teaches is how to work in an order that never disturbs what is done. Learn that and you can finish any board. If sliding puzzles are new to you — or to your child — start with Learn Sliding Puzzle: ten small steps from pushing one tile to a graduation exam.

The board sits in the middle. The dotted square is the gap, and the moves left show above it.
The board sits in the middle. The dotted square is the gap, and the moves left show above it.

First, a look at the screen

The square board sits in the middle, with buttons above and below it.

  • The board — numbered tiles, with one place left empty.
  • The dotted square — the gap. It is the only place a tile can go.
  • The line above the board — how many slides it takes to finish from here.
  • Top left — moves left, time, and slides so far.
  • Top right — how to play, undo, hint and menu.
The board sits in the middle. The dotted square is the gap, and the moves left show above it.
The board sits in the middle. The dotted square is the gap, and the moves left show above it.

A tile in its proper place turns green, so you can see how far along you are at a glance.

This is what solved looks like

From the top left, 1, 2, 3 … running right, then carrying on at the left of the next row — the order you read a page in.

The gap comes last, at the bottom right.

Solved: 1, 2, 3 … from the top left, with the gap at the bottom right.
Solved: 1, 2, 3 … from the top left, with the gap at the bottom right.

A 4x4 board holds fifteen tiles, 1 to 15. That is why this was long known as the 15 puzzle.

Only tiles touching the gap will slide

A tile can only move into the gap, which means only the tiles above, below, left and right of it can move at all.

Anything further away will not budge, however often you tap it. A tile that can move brightens slightly when you touch it.

Only tiles touching the gap will slide. Tap one further away as often as you like — it stays put.
Only tiles touching the gap will slide. Tap one further away as often as you like — it stays put.

With the gap in the middle of the board, four tiles can move; on an edge, three; in a corner, two.

Several slide at once

Tap a tile in the same row or the same column as the gap and every tile between them slides together.

Say the gap is at the left end of a row and you tap the tile at the right end: the whole row shifts one place left.

  • One tap moves several tiles, which is far easier on the hand.
  • Your slide count goes up by the number of tiles that actually moved.
  • A tile that shares neither row nor column — one on the diagonal — does nothing when tapped.
Tap a tile in the same line as the gap and every tile between them slides along together.
Tap a tile in the same line as the gap and every tile between them slides along together.

With a finger this is much quicker, since you can pull a distant tile across in one go.

The arrow keys slide too

With a keyboard, the arrow keys are quicker. An arrow points the way the tile moves.

Press ← and a tile slides left. It reads from the tile's side, not the gap's, so there is nothing to get backwards.

The arrow keys point the way the tile moves. Press ← and a tile slides left.
The arrow keys point the way the tile moves. Press ← and a tile slides left.

Besides those, H is hint, N is a new board, and Ctrl+Z is undo.

Some arrangements sliding can never reach

This is the most surprising thing about the puzzle. Shuffle the tiles at random and half the arrangements cannot be solved at all.

Swapping just two tiles is enough. It looks like a finished board with only 14 and 15 exchanged — and no amount of sliding will ever fix it.

Here only 14 and 15 are swapped. It looks a move away, but it can never be solved.
Here only 14 and 15 are swapped. It looks a move away, but it can never be solved.

When the puzzle was a craze, a man offered a prize to anyone who could solve the board with 14 and 15 exchanged. Nobody ever collected. It was an unsolvable board.

Only solvable boards are handed out

So boards here are built like this. Start from a solved board and slide at random, many times, to scramble it.

Since sliding is what scrambled it, retracing those slides always solves it. An unsolvable board cannot arise.

Boards are built by sliding backwards from a solved one. Retrace those slides and it always comes out.
Boards are built by sliding backwards from a solved one. Retrace those slides and it always comes out.

A board someone sends you is checked again at your end. Hand-editing the link to send an unsolvable board will not open.

A row at a time from the top — this one method is enough

Sliding wherever the mood takes you never finishes, because placing one tile disturbs another. The method is simply never to touch what is already placed.

  • 1. Solve the top row from the left — 1, 2, 3, 4 in turn.
  • 2. Once the top row is done, treat it as no longer there. Never touch it again.
  • 3. Do the same with the next row.
  • 4. When two rows are left, switch from rows to columns, working from the left.
  • 5. When only a 2x2 remains, walk the gap round in a circle to finish.
Work down a row at a time from the top. A tile in its place turns green.
Work down a row at a time from the top. A tile in its place turns green.

Keep to that order and any board comes out. The Hint on screen follows exactly the same order.

The last two tiles of a row are the hard part

Working along a row, you jam on the last two tiles: put one in its place and there is nowhere left for the other.

There is a trick. Do not place them one at a time. Instead, stand them upright at the end of the row and turn them both in together.

  • Say 3 and 4 are still to go. Put the 3 in the 4's place.
  • Then put the 4 directly beneath it.
  • Now bring the gap round to the left of the 3 and slide right, then down.
  • Both 3 and 4 drop into place together.
The last two tiles of a row are stood upright at the end of it, then turned in together.
The last two tiles of a row are stood upright at the end of it, then turned in together.

Columns work the same way — just turn the whole idea ninety degrees. If it gets confusing, press Hint and watch it done.

The final 2x2

With the upper rows and the left columns done, a 2x2 is left at the bottom right — three tiles and the gap.

There is nothing to think about here. Walk the gap round one way and it comes right, within three turns at most.

Only the final 2x2 is left. From here, walking the gap round in a circle solves it.
Only the final 2x2 is left. From here, walking the gap round in a circle solves it.

Reach this and you have already won. Going the other way round is sometimes quicker, so try both.

Why half of them cannot be solved

A short account for the curious. You can play perfectly well without it.

Lay the tiles out in a single line and count the pairs where the earlier tile is larger than the later one. Call that the number of inversions. A solved board has 0.

  • Sliding a tile sideways leaves that number unchanged, because the order in the line does not alter.
  • Sliding up or down changes it by an odd amount, because one tile leaps over several places in the line.
  • But sliding up or down also moves the gap one row.
  • So taking the inversion count together with which row the gap is in gives a value that no slide ever changes.
Lay the tiles out in one line and count the pairs that are out of order. That count decides whether the board can be solved.
Lay the tiles out in one line and count the pairs that are out of order. That count decides whether the board can be solved.

If that value differs from the solved board's, the board can never be solved. Swapping two tiles flips exactly that value — which is why offering a prize for the 14-15 board was perfectly safe.

The moves left are always on show

Above the board it says moves left: N — how many slides it takes to finish from here.

A good slide takes it down by one; a careless one puts it up.

  • If the number drops, you are on track.
  • If it goes up, that slide was wasted. Press undo.
  • When it reaches 0, you are done.
The moves left show above the board. Slide well and this number drops by one each time.
The moves left show above the board. Slide well and this number drops by one each time.

The number is the length of the route the hint follows. A shorter one may exist, but this one always finishes.

Hint marks one tile to slide

Press Hint at the top and the next tile to slide gets a blue ring, with its number named below.

Tap where it points and the moves left always drop by one.

Hint marks the next tile to slide in blue, and says how many slides remain below.
Hint marks the next tile to slide in blue, and says how many slides remain below.

There is no penalty for asking as often as you like. Following the hint alone will finish the board — though that rather spoils the fun.

Undo

Press Undo at the top and your last slide never happened. There is no limit — you can go right back to the start.

Undo earns its keep here. Disturb a row you had already placed and you can take it straight back.

The top bar. Moves left, time and slides on the left; undo and hint on the right.
The top bar. Moves left, time and slides on the left; undo and hint on the right.

On a keyboard it is Ctrl+Z.

Choosing the board size

The menu offers three sizes: 3x3, 4x4 and 5x5.

  • 3x3 — eight tiles. Just right for learning the method.
  • 4x4 — fifteen tiles. The size most people play.
  • 5x5 — twenty-four tiles. Worth trying once the row-by-row order is second nature.
The menu sets the board to 3x3, 4x4 or 5x5. Each size keeps its own record.
The menu sets the board to 3x3, 4x4 or 5x5. Each size keeps its own record.

Each size keeps its own best — slides used and time taken.

Replay and sharing

Once it is solved, Replay gives you the same board again. There is real pleasure in finishing it in fewer slides.

Copy link packs the board into a URL. Send it on and the very same board opens for them.

Solve it and you get replay and copy-link buttons, so you can send the same board on.
Solve it and you get replay and copy-link buttons, so you can send the same board on.

Their end checks again that the board can be solved.

Today's puzzle

Today's puzzle at the bottom opens the board set for that day. It is built from the date, so everyone gets the same board.

With one board between you, you can see who used fewer slides.

Today's puzzle at the bottom opens the board set for that day — the same one for everybody.
Today's puzzle at the bottom opens the board set for that day — the same one for everybody.

It uses whichever size you have chosen.

How to win

Keep to these and you can finish any board.

  • Never touch a row you have already solved. That is the whole of it.
  • Start at the top row, then the next. With two rows left, switch to columns.
  • The last two tiles of a row go in together — stand them upright and turn them in.
  • Use multi-tile slides. One tap moves several places.
  • The arrow keys beat a finger for speed.
  • Watch the moves-left number. Dropping by one each slide means you are on track.
  • Play a few 3x3 boards. The method is identical and it finishes far sooner.
The top two rows and the left column are done. Once a part is right, you leave it alone.
The top two rows and the left column are done. Once a part is right, you leave it alone.

Common mistakes

Boards that leave people floundering are nearly always one of these four.

  • Going after whatever tile catches your eye — the commonest of all. Place one and another comes apart, and it never ends. You have to keep to the order.
  • Going back into a solved row — the moment you do, you are starting over.
  • Trying to place the last two tiles one at a time — it will never work. Stand them upright and turn them in together.
  • Agonising over the final 2x2 — there is nothing to think about. Walk the gap round and it comes right.
Here tiles were slid at random, with no order. The green is scattered, so there is no telling how far along it is.
Here tiles were slid at random, with no order. The green is scattered, so there is no telling how far along it is.

Think better of a slide and undo at once. If the moves-left number went up, that slide was wasted.

When it is solved

Get them running from 1 in order and it ends there. Every tile turns green, and you are shown your slides and your time.

Try the same board again with Replay and finish it in fewer.

Solved, every tile turns green, and your slides and time are shown.
Solved, every tile turns green, and your slides and time are shown.

Each size keeps its own best.

Common questions

I tapped a tile and it did not move.

A tile has to share a row or a column with the gap. One sitting diagonally away will not move, however often you tap it.

What I have placed keeps coming apart.

That is what sliding without an order does. Solve a row at a time from the top, and never touch a finished row. Then nothing comes apart.

The last two tiles of the row will not go in.

They will not go in one at a time. Put the first tile in the end place of the row and the second directly beneath it, then bring the gap round and turn them both in.

Could this board be unsolvable?

No. Boards here are built by sliding backwards from a solved board. Retracing always solves it. The moves left number above the board is the proof.

Do unsolvable boards really exist?

They do. Swapping just two tiles makes a board that can never come out, and a random shuffle produces one half the time. If a board from elsewhere will not solve, that may well be why.

The moves-left number went up.

That means your last slide was wasted work. Press Undo and look again.

Is that the shortest route?

On a 3x3 it is the shortest route. On 4x4 and 5x5, finding the shortest takes far too long, so it follows the order a person would solve it in instead. A little longer, but it always finishes.

Which way do the arrow keys read?

The way the tile moves. Press ← and a tile slides left.

Where do I change the board size?

In the menu at the top, choose 3x3, 4x4 or 5x5. Each size keeps its own best.

If it is your first time
  • Solve the top row first. Leave a finished row alone and work only on what is below it.
  • Then the next row down. The last two rows have to be solved together.
  • The last two tiles of a row are easiest if you stand them up vertically first.
  • Press Hint when you are stuck. It points at one tile to slide.