↑↓ to move ↵ to open Esc to close Browse all tools

Sudoku Solver

Type or paste a puzzle to solve it, or play it here with live conflict checks, hints that explain the next step and a check of your own entries.

Sudoku solver

Type 1 to 9, use the arrow keys to move, Backspace to clear. Paste 81 digits anywhere on the grid.

Ready

Fill in the puzzle or pick an example.

Example puzzles
81 characters, row by row: digits for clues, a dot or 0 for empty cells. Paste here to load a puzzle.

Runs on your device. The puzzle is solved in your browser and not uploaded.

Sudoku Solver by Freebiefy, free online tools

Embed this tool on your site

Paste this code into your page. The tool runs in the visitor's browser, free and without signup. The height adjusts to the content. All tools you can embed

How the solver finds the answer

A Sudoku grid has 81 cells in 9 rows, 9 columns and 9 boxes of 3 by 3. Every row, column and box must hold the digits 1 to 9 once each. The solver keeps, for every empty cell, the set of digits that do not clash with its row, column and box yet. Then it repeats three simple moves:

  • Fill forced cells. If a cell has one digit left, or a digit has one place left in a row, column or box, it goes in without guessing.
  • Try the tightest cell. When nothing is forced, it picks the cell with the fewest options, usually two, and tries them one at a time.
  • Back up on a dead end. When a cell has no digit left, or a digit has no place left in some row, column or box, the last try was wrong, and the solver undoes it.

This is called constraint propagation with backtracking. Because the solver tries every option that is not ruled out, it never misses an answer, and the result is exact. The example puzzles on this page take a few milliseconds. The search runs in a background thread of your browser, so the page stays responsive even with a sparse grid, and a Stop button appears if it takes longer than a moment.

One solution, none, or several

A proper Sudoku has a unique solution: exactly one way to fill the grid. The solver does not stop at the first answer: it keeps looking for a second one, which tells you which of three cases you have.

ResultWhat it meansWhat to do
One solutionThe clues fix every cellSolve it yourself with hints, or show the answer
No solutionThe clues contradict each otherLook for a mistyped clue, often a single digit
More than oneThe clues leave some cells openCheck for a missing clue; the solver shows two answers

A puzzle needs at least 17 clues to have only one solution. That was settled in 2012 by an exhaustive computer search that found no valid puzzle with 16 clues. More clues do not guarantee a single answer, though, so the solver checks every grid the same way. The clue count is shown above the grid.

Hints that explain the next step

The Hint button does not just reveal a digit. It looks for a step you could find with a pencil and says why it works:

  • Hidden single: a digit can go in only one cell of a row, column or box, because every other empty cell there already sees that digit.
  • Naked single: a cell's row, column and box together already hold eight different digits, so only one is left.

The cell lights up, the row, column or box that explains it is shaded, and you can fill it in with one tap. The easy example on this page can be solved with these two steps alone. Harder puzzles can reach a point where neither applies and a more advanced technique is needed. Then the hint says so and offers to reveal the cell with the fewest options. Before giving a hint, the tool checks your entries against the solution, so a hint never builds on a wrong digit.

Playing on this page

Press Enter puzzle and type the clues, or paste them. Switch to Play and the clues lock in bold, so your own digits can never overwrite them. Your entries appear in green, digits filled in by the solver in gray. A digit that repeats in a row, column or box turns red at once, and the message box names the row, column or box. Check my entries compares what you have filled in with the solution and marks every wrong cell, without showing the right digit. Undo takes back any change, including a hint you filled in or a solve.

On a phone, tap a cell and use the number pad next to the grid, so the keyboard does not cover the puzzle. On a computer, type straight into the grid and move with the arrow keys. A copied link keeps the puzzle and your entries, which is handy for finishing later or for sending a tricky grid to a friend.

Text formats you can paste

The solver reads the grid row by row from the top left. Digits 1 to 9 are clues, and 0, a dot, an underscore, a question mark, a star or an x are empty cells. Everything used for drawing a grid is skipped: spaces, line breaks, |, -, + and =. These all load the same puzzle:

  • .13.5..8..76.4............6..73……
  • 013050080 076040000 000000006 …
  • Nine lines with | between boxes and a line of dashes between bands, as Copy grid makes it

The puzzle game is also known as Number Place. Sudoku is a registered trademark of the Japanese puzzle publisher Nikoli in Japan, and other publishers there use the name Number Place.

How to use the Sudoku solver

  1. 1Press Clear all, then type the clues into the grid or paste the whole puzzle into the text field. Red cells show a digit that repeats.
  2. 2Press Solve to see the full answer and whether it is the only one, or switch to Play and fill in the grid yourself.
  3. 3Stuck? Press Hint for the next cell and the reason, or Check my entries to find mistakes. Copy the grid or a link to keep your progress.

Frequently asked questions

How does the Sudoku solver work?

It searches every possibility, but in a smart order. It always fills the cell with the fewest digits left, places a digit at once when it is the only one that fits a row, column or box, and backs up as soon as a cell or digit runs out of places. That way even the hard example on this page takes a fraction of a second, and the answer is exact, not a guess.

What if my puzzle has more than one solution?

The solver keeps searching after the first answer until it finds a second one. If there is one, it tells you the puzzle has more than one solution and lets you switch between two of them. A well-made puzzle has exactly one, so this usually means a clue was typed wrong or left out.

What does "no solution" mean if there is no conflict?

No digit repeats right now, but the clues still contradict each other further down the line, so some cell or some digit runs out of places. The most common cause is a single wrong clue. Compare the grid with your source, fix the clue and press Solve again.

What are a naked single and a hidden single?

A naked single is a cell where the row, column and box already hold eight different digits, so only one digit is left for it. A hidden single is a digit that fits in only one cell of a row, column or box, even if that cell could hold other digits. The Hint button finds these and explains the reason.

Can I paste a puzzle from somewhere else?

Yes. Paste 81 characters into the text field or straight onto the grid: digits 1 to 9 for clues and 0, a dot or an underscore for empty cells. Spaces, line breaks and lines like | and - are skipped, so most printed and copied layouts work as they are.

Is my puzzle sent anywhere?

No. The puzzle is solved by your own browser, on your device. The page does not upload the grid. A link you copy holds the puzzle and your entries in the address, so whoever opens it sees the same grid.