Slide puzzle
Slide the tiles back into order — numbers or your own picture.
Tap a tile next to the gap — or one further along the gap’s row or column to slide the whole line. Arrow keys, WASD and swipes work too.
Nothing leaves your device
This tool runs entirely in your browser. What you type, play or record here stays on your device: nothing is uploaded or saved on a server.
Example
Can this 8 puzzle be solved? Counting inversions, and the boards that take 31 moves
The page deals only puzzles that can be solved. To check a 3 × 3 board yourself, read the tiles row by row, skip the gap and count the pairs in the wrong order (inversions): on a board 3 wide an even count can be solved, an odd one never.
- 1 2 3 / 4 5 6 / 8 7 _ has one inversion, 8 before 7: odd, so no slides fix it. When a shuffle comes out like that, the page swaps two tiles before dealing it.
- 8 6 7 / 2 5 4 / 3 _ 1 has 24 inversions: even, so it can be solved, but the fewest slides is 31, the most any 8 puzzle needs. Only 6 4 7 / 8 5 _ / 3 2 1 is as far.
- On a board 4 wide, add the rows above the gap; the total must be odd. Sam Loyd’s 14–15 puzzle (1 … 13, 15, 14, gap) has 1 + 3 = 4: never solvable.
- Moves counts tiles: tapping a tile two squares from the gap slides both and adds 2.
| Board | Tiles | Solvable arrangements | A new deal starts at least |
|---|---|---|---|
| 3 × 3 | 8 | 181,440 | 12 squares from solved |
| 4 × 4 | 15 | 10,461,394,944,000 | 20 squares from solved |
| 5 × 5 | 24 | about 7.76 × 10²⁴ | 30 squares from solved |
| 6 × 6 | 35 | about 1.86 × 10⁴¹ | 42 squares from solved |
“Squares from solved” adds up each tile’s row and column distance from its own square, so a fresh puzzle is never a few slides from done. Over all 147,633 boards the page can deal on 3 × 3, the shortest solution averages 22.7 slides.
How it works
- Choose the board size, and numbers or a photo (upload your own).
- Slide tiles into the gap — tap a tile, use the arrow keys or swipe.
- Put every tile back in order to win; your best moves and time are kept.
Frequently asked questions
- How do you solve the 15 puzzle?
- Solve it row by row: place the top row, then the next, and finish the last two rows column by column. Bring each tile close first, then circle it into place without disturbing the finished part.
- Is every puzzle solvable?
- Yes — half of all random arrangements can’t be solved, so the page only deals ones that can.
- Can I use my own photo?
- Yes — choose Photo and pick a picture; it is cut into tiles in your browser and never uploaded. Peek shows the whole picture, and small numbers can be turned on to help.
- Which size should I pick?
- 3 × 3 (the 8 puzzle) takes a minute, 4 × 4 is the classic 15 puzzle, and 5 × 5 or 6 × 6 are long challenges.
- What is the fewest number of moves for the 8 puzzle?
- Every solvable 3 × 3 board can be finished in 31 slides or fewer, and only two boards need all 31: 8 6 7 / 2 5 4 / 3 _ 1 and 6 4 7 / 8 5 _ / 3 2 1. The page counts every tile that moves, so a row slid at once counts each of its tiles.
- What if 14 and 15 end up swapped?
- With everything else in place, that board — Sam Loyd’s famous 14–15 puzzle — can’t be solved, and you won’t meet it here: every deal can be solved, and sliding never turns a solvable board into one that isn’t. If the last row reads 13 15 14, another tile or the gap is still out of place.
- Is anything sent anywhere?
- No. The puzzle runs in your browser.