Sliding Puzzle
Slide the tiles back into order, 1 to the last, with the gap at the end.
Moves
0
Time
0:00
Best
–
Solved!
3×3 · 8 tiles
Tap a tile in line with the gap, or swipe on the board
Settings: pictures, your photo, controls
Tiles
Your photo is cropped to a square and cut into tiles right here in your browser. It is never uploaded.
About the sliding puzzle
A sliding puzzle is a square frame of numbered tiles with one empty space. Tiles can only move by sliding into that gap, so every move shifts the gap somewhere new, and your goal is to put the numbers back in reading order: 1 in the top-left corner, counting across each row, with the gap in the bottom-right. This version plays free in your browser. It has the 3×3 board (the 8-puzzle), the classic 4×4 board (the famous 15-puzzle), and 5×5 and 6×6 boards for long solves. Every shuffle is checked to be solvable. You can slide whole rows at once, play with the arrow keys or by swiping, turn the tiles into a picture or your own photo, solve the same daily 15-puzzle as everyone else, ask for a hint, and track best times and fewest moves. Your puzzle saves itself after every move.
How to play
- Pick a board size. 3×3 is the quickest; 4×4 is the classic 15-puzzle.
- Study the shuffle. The clock doesn't start until you move a tile.
- Tap or click a tile next to the gap to slide it in. A tile further along the same row or column slides every tile between it and the gap together.
- Keep going until the tiles read 1, 2, 3… across each row, with the gap in the bottom-right corner.
- When the last tile clicks into place you'll see your moves and time, and on 3×3 the shortest possible solution for that shuffle. Shuffle deals a new puzzle; Restart takes you back to the start of this one.
Controls
| Action | Mouse or touch | Keyboard |
|---|---|---|
| Slide one tile | Tap or click a tile next to the gap, or swipe toward the gap | Arrow keys or W, A, S, D |
| Slide a whole row or column | Tap or click the far tile in line with the gap | Repeat the arrow key |
| Hint (3×3 and 4×4) | Hint button | H |
An arrow key slides a tile in that direction: Left slides the tile to the right of the gap into it. If you think in terms of moving the gap instead, switch on "Arrow keys move the gap" in Settings. Moves count tiles, so sliding a row of three tiles at once adds three moves.
Board sizes
| Board | Also called | Solvable positions | What it's like |
|---|---|---|---|
| 3×3 | 8-puzzle | 181,440 | Quick: a few minutes at first, much less once you know the method. The game shows the shortest solution for every deal. |
| 4×4 | 15-puzzle | 10,461,394,944,000 | The classic. Every solvable position can be solved in 80 single-tile moves or fewer. |
| 5×5 | 24-puzzle | 7,755,605,021,665,492,992,000,000 | A long solve: three layers before the last 3×3 corner. |
| 6×6 | 35-puzzle | 185,996,663,394,950,608,733,999,724,075,417,600,000,000 | A marathon for patient solvers. Same method, more layers. |
A reliable way to solve any sliding puzzle
- Solve the top row. Bring tile 1 home, then 2, and so on, without disturbing tiles you've already placed.
- Use a setup for the row's last two tiles. On the 4×4 board that's 3 and 4. Put 4 where 3 belongs, park 3 directly beneath it, and walk the gap into the row's last corner. Then slide 4 sideways into the corner and 3 up into its place.
- Solve the left column the same way, top to bottom. For its last two tiles, turn the trick on its side: the last tile in the second-to-last spot, the other tile just to its right, the gap in the bottom corner, then slide down and left.
- Repeat on what's left. On the 4×4 board the unsolved part is now a 3×3 puzzle of its own; on 5×5 and 6×6 you peel off more layers first.
- Finish the 2×2 corner. The last three tiles just rotate around the gap. Keep cycling them in one direction until they line up.
A worked example. Say tile 1 sits two squares to the right of its home in the top row, with the gap directly below it. Sliding tile 1 down would only move it away. Instead, put the gap on the side tile 1 has to travel toward: walk the gap left along the second row and up into the square left of tile 1 (two moves), then slide tile 1 left (one move). To move it one more square, the gap must travel round again, down, left twice and up (four moves), before tile 1 slides once more. So after the first step, each square a tile travels costs about five moves, which is why planning the gap's route is the whole game.
More tips
- Think about moving the gap. To push a tile somewhere, walk the gap around to the side it needs to go, then slide the tile in.
- Use whole-row slides. They're the same number of moves but far fewer taps, which makes speed solves much smoother.
- Plan before the clock starts. The timer waits for your first slide, so work out where 1 and 2 are headed before you move anything.
- Learn on 3×3 with hints. A hint there is always a move from a shortest solution, which makes the 8-puzzle a good way to see how efficient routes look.
Common mistakes
- Placing the last tile of a row directly. It always knocks its neighbour out of place; use the setup in step 2 instead.
- Breaking finished rows to fix a later one. Every finished row should stay finished; the method never needs to disturb it.
- Assuming a stuck position is unsolvable. Every deal here can be solved. If the last two tiles look swapped, a layer below is out of order, not the puzzle.
Why half of all arrangements can't be solved
Every slide swaps the gap with one tile, and a careful count shows that this can never change a quantity called the permutation's parity. Read the tiles row by row, skip the gap and count the pairs where a bigger number comes before a smaller one. On boards with an odd width (3×3, 5×5) that count is always even in a solvable position. On boards with an even width (4×4, 6×6), add the row the gap is in, counted from the bottom; the total is always odd. Lift two tiles out of a real puzzle and swap them, and you flip that parity: the puzzle can then never be finished. That's exactly the famous 14-15 puzzle: a solved 15-puzzle with only the 14 and 15 swapped. This game shuffles completely at random and, if the result fails the test, swaps two tiles, so every deal can be solved and no solvable arrangement is favoured over another (a shuffle that comes out almost solved is simply dealt again).
Picture mode and your own photo
Open Settings to swap the numbers for a picture: three built-in ones (Sunset, Ocean and Mosaic, painted by your browser) or a photo of your own. A photo is cropped to a square from its centre, scaled down and cut into tiles on your device; it's never uploaded, and it's kept in your browser's storage until you remove it. Picture puzzles are harder than numbers because you have to read where each piece belongs, so small numbers stay on the tiles unless you switch them off. Photos with a clear sky or plain background are the toughest; busy, colourful pictures are easiest.
The daily puzzle, hints and statistics
Pick Daily for today's 15-puzzle: the same shuffle for everyone, so you can compare moves and times with friends. Your first solve each day counts toward your daily streak, and Restart keeps the clock running, so the time you share is the real one. Hints show the next move on the 3×3 and 4×4 boards: on 3×3 it's a move from a shortest solution, on 4×4 a move along a short route the game finds in a fraction of a second. Statistics record, for each board, the puzzles you've played and solved, your best time, your fewest moves and your average time. Solves that used hints count, but don't set records. Everything is stored in this browser only.
A little history
The 15-puzzle is credited to Noyes Palmer Chapman, a postmaster in Canastota, New York, who showed friends an early version in the 1870s. In early 1880 it became a genuine craze across the United States, and Europe caught it that spring. Years later, the puzzle writer Sam Loyd claimed he had invented it and told of a large prize for solving the 14-15 version, a safe promise since that position can never be solved; historians have since shown he had nothing to do with the original craze. Computers finally settled the hardest question in 1999: no solvable 4×4 position needs more than 80 single-tile moves.
More puzzle games
Like shuffling tiles into place? 2048 is a sliding-tile game of a different kind, where tiles merge instead of sorting. For pure logic try a daily Sudoku or Minesweeper, and Lights Out is another grid puzzle with a neat bit of maths behind it. For a quick memory workout, play Memory Match.
Frequently asked questions
How do you solve a sliding puzzle?
Solve it in layers. Put the top row in place one tile at a time, then the left column, which leaves a smaller puzzle of the same kind. Repeat until only a 2×2 corner is left, where the last three tiles just rotate around the gap until they line up. The last two tiles of each row or column need a short setup move, described in the guide above. It won't give the fewest moves, but it works every time.
Is every sliding puzzle solvable?
No. Exactly half of all possible arrangements can never be solved, however you slide the tiles; the classic example is the 15-puzzle with only the 14 and 15 swapped. This game checks every shuffle with the standard parity test and only deals arrangements that can be solved, so if you're stuck, it's the method, not the deal.
How can you tell if a 15-puzzle is solvable?
Read the tiles row by row, ignore the gap, and count the pairs that are out of order (a larger number before a smaller one). On a board with an odd width like 3×3, the puzzle is solvable when that count is even. On an even width like 4×4, add the gap's row counted from the bottom (1 for the bottom row); the puzzle is solvable when the total is odd.
What is the fewest number of moves to solve the 15-puzzle?
It depends on the shuffle, but no solvable 4×4 position needs more than 80 single-tile moves, a limit proved by exhaustive computer search. For the 3×3 puzzle the maximum is 31. On the 3×3 board this game works out the shortest solution for every deal and shows it when you finish, so you can see how close you came.
Can I slide a whole row of tiles at once?
Yes. Tap or click any tile in the same row or column as the gap and every tile between it and the gap slides along together. Each tile that moves still counts as one move, the standard way to count sliding puzzle moves.
Can I play with the arrow keys or by swiping?
Yes. An arrow key (or W, A, S, D) slides a tile in that direction into the gap, and a swipe across the board does the same on a touchscreen. If you'd rather steer the gap, switch on "Arrow keys move the gap" in Settings.
Can I make a sliding puzzle from my own photo?
Yes. Open Settings, choose Your photo and pick any picture on your device. It's cropped to a square and cut into tiles on the board. The photo is processed in your browser and never uploaded; it's kept in your browser's storage so it's there next time, and Remove photo deletes it. You can keep small numbers on the picture tiles or hide them for a harder solve.
What is the daily sliding puzzle?
Each day there's one 15-puzzle shuffle that's the same for everyone, so you can compare moves and times with friends. Your first solve of the day counts toward your daily streak. Restart takes you back to the starting shuffle but keeps the clock and move count running, so the time you share is honest.
What's the difference between the 3×3, 4×4, 5×5 and 6×6 boards?
The 3×3 board (the 8-puzzle) has 181,440 solvable positions and takes most people a few minutes. The 4×4 board is the classic 15-puzzle, with over ten trillion positions. The 5×5 and 6×6 boards are long solves that use exactly the same layer-by-layer method, just with more layers.
How do the hints work?
On the 3×3 board a hint shows the next move of a shortest solution and how many moves are left. On the 4×4 board it follows a short route found by a quick search, which is usually a little longer than the shortest but always finishes the puzzle. Hints aren't offered on 5×5 and 6×6, and a solve that used hints doesn't set best times or move records.
Does the game save my progress and best times?
Yes. The puzzle in progress on each board size is saved after every move, so you can close the page and carry on later. Statistics keep your solves, best time, fewest moves and average time for each size, plus your daily streak. Everything is stored in your browser on this device; nothing is uploaded.
Who invented the 15 puzzle?
It's credited to Noyes Palmer Chapman, a postmaster in Canastota, New York, who showed friends an early version in the 1870s. It became a craze across the United States in early 1880 and reached Europe that spring. The puzzle writer Sam Loyd later claimed to have invented it, but historians have shown he had nothing to do with the original craze.
More games to play
Free, browser-based, and instant — no installs or accounts.