Sliding puzzle with your own photo

Sliding puzzle: slide the tiles into the gap until everything is back in order. Add your own photo to turn it into a picture puzzle – every shuffle is guaranteed to be solvable.

Source: Wikipedia: 15 puzzle – Lösbarkeit (Johnson & Story 1879, Paritäts-Invariante), Sam Loyd, 80 Züge, Chapman/1880. Updated: .

Moves
0
Time
0:00
Fewest moves
–
Best time
–

Tap a tile next to the gap – or one further along the same row or column.

How to play: tap a tile. Keyboard: click the board or Tab to it, then the arrow keys slide a tile into the gap.

Your photo is cropped (square, centred) only in this browser – it is never uploaded or stored.

Best results and settings are stored only in this browser (localStorage).

My Toolbox

Result

How it is calculated

How the sliding puzzle works

In the 15 puzzle, 15 numbered tiles sit in a 4 × 4 frame with one empty square. You slide tiles into the gap until they read 1 to 15 with the gap in the bottom-right corner. Tap a tile further along the same row or column and the whole line slides at once – counted as one move per tile moved.

  1. Choose a size: 3 × 3 is quick, 4 × 4 is the classic, 5 × 5 takes patience.
  2. Your own photo: pick a picture from your phone or computer. It is cropped to a centred square and cut into tiles; numbers can be shown as a help.
  3. Slide: tap, or use the arrow keys (arrow up moves the tile below the gap upwards).

Why every shuffle is solvable

Not every arrangement can be solved – exactly half of all positions are impossible. Johnson and Story proved this in 1879: the parity of the permutation of all squares plus the distance of the gap from the bottom-right corner never changes with a move. Sam Loyd made this famous with his unsolvable puzzle where only 14 and 15 are swapped. This puzzle checks every shuffle with exactly that rule and swaps two tiles if necessary, so you always get a solvable one.

Tips for solving

Privacy and storage

Your photo never leaves your device: it is cropped in the browser and shown only for this session as a local blob address; it is not saved. Fewest moves, best time per size and your settings are kept in localStorage (key schiebepuzzle). Shuffling uses the browser’s cryptography API.

More puzzles: Sudoku, 2048 and block puzzle.

Frequently asked questions

How do you solve a sliding puzzle?

Row by row: first the top row, then the left column, then the smaller remaining puzzle the same way. Insert the last tiles of a row in pairs and finish the last squares by cycling tiles around the gap.

Is every 15 puzzle solvable?

No – exactly half of all arrangements are unsolvable, for example when only 14 and 15 are swapped. Here you only get shuffles that are guaranteed solvable by the parity rule.

Can I make a sliding puzzle with my own picture?

Yes. Tap “Choose your own photo”; the picture is cropped to a square and cut into tiles. It is not uploaded.

What is the minimum number of moves for the 15 puzzle?

The shortest solution of any 4 × 4 shuffle needs at most 80 single-tile moves – the 17 hardest positions need exactly that many. Without a computer you will usually need more; the counter here tracks your best.

Who invented the 15 puzzle?

It is credited to postmaster Noyes Palmer Chapman and became a craze in the USA in 1880. Sam Loyd later falsely claimed to have invented it.

Sources and legal basis

As of: · Editorial policy

Related tools