Home › Fun & Games › Sliding Puzzle

Sliding Puzzle

Slide the tiles back into order on a 3×3 to 6×6 board using numbers, a colorful sample picture or your own photo. Every shuffle is guaranteed solvable, and your photo never leaves your device.

Last updated:

Board size
Tiles
Moves0
Time0:00
Best 4×4–

Tap a tile next to the gap (or any tile in its row/column to slide several), swipe on the board, or use the arrow keys after clicking the board.

Advertisement

How to use the Sliding Puzzle

  1. Pick a board size: 3×3 is quick, 4×4 is the classic 15 puzzle, 5×5 and 6×6 are a real challenge.
  2. Choose numbers or a picture. In Picture mode, pick a sample image or press Upload your photo.
  3. Slide tiles into the gap by tapping or clicking them, swiping on the board, or using the arrow keys.
  4. Put the tiles in order: 1, 2, 3… left to right, top to bottom, with the gap in the bottom-right corner.
  5. Press Shuffle any time for a new solvable game and try to beat your best time and move count.

Why half of all shuffles are impossible

If you pull the tiles out of a 15 puzzle and put them back at random, there is a 50% chance the puzzle can never be solved. In 1880 Sam Loyd famously offered a prize for solving the "14-15 puzzle", a starting position with only tiles 14 and 15 swapped, which is mathematically impossible.

The rule uses inversions: read the tiles left to right, top to bottom (ignoring the gap) and count every pair where a larger number comes before a smaller one.

Board widthThe position is solvable when…
Odd (3×3, 5×5)the number of inversions is even
Even (4×4, 6×6)inversions + the gap's row counted from the bottom (1 = bottom row) is odd

This game checks every shuffle with that rule and swaps two tiles when needed, so you always get a puzzle that can be finished.

Board sizes compared

BoardTilesSolvable positionsHardest position (moves)
3×3 (8 puzzle)8181,44031
4×4 (15 puzzle)15about 10.5 trillion80
5×5 (24 puzzle)24about 7.8 × 1024unknown (at least 152)
6×6 (35 puzzle)35about 1.9 × 1041unknown

A simple method that always works

  1. Top row first. Bring 1, 2 and 3 into place one at a time. For the last two tiles of the row (3 and 4 on a 4×4), park 3 in the top-right corner and 4 directly below it, bring the gap to 3's target spot, then slide 3 left and 4 up.
  2. Repeat row by row until two rows remain. The rows you have finished are never touched again, so the board effectively shrinks.
  3. Finish the last two rows column by column. Place the top and bottom tile of each column as a pair, from left to right, cycling tiles around a 2×2 or 2×3 loop.

Picture puzzles are solved exactly the same way. Turn on Show numbers on picture tiles if the image has large areas of similar color. If you like logic games, also try Sudoku, 2048 or Minesweeper.

Frequently asked questions

Is every shuffle solvable?

Yes. Exactly half of all random tile arrangements cannot be solved. This puzzle counts the inversions of every shuffle (and, on even-sized boards, the row of the gap) and fixes the arrangement before you see it, so every game can be finished.

What is the 15 puzzle?

The 15 puzzle is a 4×4 frame with 15 numbered tiles and one empty space. It became a worldwide craze in 1880. You slide tiles into the gap until the numbers run from 1 to 15 in order with the gap in the bottom-right corner.

What is the fewest number of moves needed?

Any 3×3 (8 puzzle) position can be solved in at most 31 moves and any 4×4 position in at most 80 single-tile moves, which was proven by computer search. Typical human solutions take more, often 100 to 200 moves for a 4×4.

How are moves counted?

Each tile that moves counts as one move. If you tap a tile two places away from the gap, both tiles slide and two moves are added.

Is there a strategy for solving it?

Solve the puzzle row by row: finish the top row, then the second row, and so on until only a 2×3 or 3×2 block remains, then solve that last block by rotating tiles around it. Place the last two tiles of a row together by parking them in a column first.

Can I use my own picture?

Yes. Switch to Picture mode and press Upload your photo. The image is cropped to a square and cut into tiles right in your browser. It is not uploaded anywhere.

Are my best results saved?

Your best time and fewest moves for each board size are stored in your browser's local storage on this device. Use Clear best to reset the record for the current size.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

2048 GamePlay 2048 online with swipe controls, undo and best score.Sudoku OnlinePlay free Sudoku with 4 difficulty levels, notes, hints and a timer.MinesweeperPlay classic Minesweeper: 3 difficulties, flags, timer and a safe first click.Memory Card GameFlip cards and match emoji pairs on 4×3 to 6×6 grids, with moves, timer and best scores.SolitairePlay classic Klondike Solitaire with Draw 1 or Draw 3 and undo.Spider SolitairePlay Spider Solitaire online with 1, 2 or 4 suits, hints, unlimited undo and a timer.Play Chess vs ComputerPlay chess online against the computer at 8 difficulty levels.Connect FourPlay Connect 4 online against the computer or a friend.Snake GamePlay classic Snake online with speeds, wall modes and high scores.Tic Tac ToePlay tic tac toe against an unbeatable AI or a friend.Block Puzzle GameClassic falling blocks puzzle game with levels and high score.Word Guess GameGuess the hidden five-letter word in six tries. Unlimited games, stats and hard mode.HangmanClassic friendly hangman word game with categories, hints and difficulty levels.Flappy GameTap to flap a round chick through bamboo gaps and beat your high score.Dino Runner GameJump cacti and duck buzzing beetles in an original endless desert runner.Typing GameType the falling words before they land; level up and track your WPM and accuracy.Math Quiz GameTimed mental math rounds with four operations, five levels, streaks and high scores.Flag QuizGuess the flags of all 196 countries in four modes, from multiple choice to timed.Map QuizFind countries on a clickable world map or name the highlighted one, by continent.Periodic Table QuizLearn all 118 elements: quiz symbols, names and atomic numbers or click them on the table.Spelling Bee GameMake words from 7 honeycomb letters, always using the center letter. New daily puzzle.Jigsaw PuzzleTurn a sample picture or your own photo into a 12 to 150 piece jigsaw puzzle and solve it.Mahjong SolitaireMatch pairs of free tiles to clear the Turtle and two smaller layouts, with hints, shuffle and undo.Scrabble Word FinderFind the highest-scoring words from your rack, with blank tiles, patterns and bingo bonus.Wordle SolverEnter your guesses and colours to see every possible answer and the best next guess.Crossword SolverFind words that fit a crossword pattern like c?t from the length and the letters you know.Word Search GeneratorMake a word search puzzle from your words, play it online or print it with an answer key.Pong GamePlay classic Pong online against the computer on 3 levels or with a friend, first to 11.Breakout GameClassic brick breaker game with levels, power-ups and lives. Play with mouse, touch or keyboard.Whack-a-MoleWhack the moles before they hide in 30 or 60 second rounds. Speed increases, best score saved.Simon Says GameRepeat the growing color and sound sequence. Classic memory game with strict mode and high score.CheckersPlay checkers online against the computer or a friend, with kings, undo and hints.ReversiPlay Reversi (Othello rules) online vs a 3-level computer or a friend, with move hints.GomokuGet five in a row on a 15×15 board against a smart computer or a friend.Battleship GamePlace your fleet and sink the computer's ships in this classic naval guessing game.FreeCellPlay FreeCell solitaire online with the classic numbered deals, undo, hints and auto-move.Mastermind GameCrack the secret 4-color code in 10 tries using black and white feedback pegs.Tower of HanoiPlay the Tower of Hanoi puzzle with 3 to 8 disks, or watch it solve itself in the fewest moves.Snakes and LaddersPlay the classic board game online with 2-4 players or against the computer.Space Shooter GameRetro arcade space shooter: blast alien waves and meteors, grab power-ups and beat your high score.Spades Card GamePlay Spades online with a computer partner: bid tricks or nil, trump with spades, avoid bags.Stack Tower GameTap to drop sliding blocks and build the tallest tower. Perfect drops earn bonus points.US States QuizFind the 50 states on a clickable US map, type them all from memory, or match state capitals.Virtual Bubble WrapPop endless bubble wrap with click, touch or drag. Satisfying pop sounds and a pop-it fidget mode.Word Grid GameFind words in a 4x4 or 5x5 letter grid by dragging across adjacent letters before time runs out.Word Ladder GameChange one letter at a time to turn one word into another. Daily and random word ladders.Chess PuzzlesSolve chess puzzles online: mate in 1, 2 and 3 plus tactics, with hints, a rating and streaks.Clicker GameIdle clicker: mine gems, hire builders, buy upgrades, rebirth for stars and earn while you're away.Color by NumberTap numbered pixels to color pictures, or turn your own photo into a color by number puzzle.Online Coloring PagesColor animal, holiday and mandala pages online with bucket fill and brushes, then print or save PNG.Connections Word PuzzleGroup 16 words into 4 hidden categories. New daily puzzle, full archive, shareable results.Daily Crossword PuzzleA free new crossword every day: quick 5x5 mini or a bigger 13x13, with check, reveal and timer.Farkle Dice GamePlay Farkle online vs the computer or pass-and-play: pick scoring dice, risk it or bank to 10,000.Gin RummyPlay Gin Rummy vs the computer: draw, discard, knock or go gin. Melds found automatically.Jeopardy-Style Quiz Board MakerMake a categories-and-points quiz board, then play it full screen with teams and live scores.Name All Countries QuizType as many of the world's 197 countries as you can in 15 minutes while the map fills in.Piano Tiles GameTap the black tiles to play classic melodies. It speeds up as you go; beat your high score.Pinball GamePlay pinball online with real flipper physics, bumpers, a wire ramp, drop targets and multiball.8 Ball Pool GamePlay 8 ball pool online vs the computer or a friend: aim line, power meter, spin and real physics.Cube SimulatorTurn a 3D 2x2 to 5x5 puzzle cube online: drag or type moves, scramble, time solves and undo.TriPeaks SolitairePlay TriPeaks Solitaire free: clear three peaks with up-or-down runs, streak bonuses, undo and hints.Water Sort PuzzlePour colored water between tubes until every tube holds a single color. Endless solvable levels.20 Questions GameThink of an animal or object and the game guesses it with yes/no questions, then learns.24 GameCombine four numbers with + − × ÷ to make 24. Endless solvable hands, timer and a solver.Asteroids GameClassic vector Asteroids arcade: rotate, thrust and blast space rocks into pieces, wave after wave.Basketball Shooting GameDrag and release to shoot hoops against a 60-second clock, with moving-hoop levels and combo bonuses.Bible Trivia QuizMultiple-choice Bible trivia by book and difficulty, with verse references and a kids mode.Contract BridgePlay contract bridge with 3 computer players: SAYC-style bidding, declarer play, duplicate scoring.
See all 141 Online Games →