Sudoku Solver
Enter a 9×9 Sudoku to solve it, work through one explained step at a time, or check your own entries. Choose classic rules or X Sudoku, which also checks both main diagonals. Type, paste a text grid, or tap the number buttons to fill a selected square.
Selected: R1C1
Type the givens into the grid, or paste 81 characters, then press Solve. Arrow keys move, a digit types, backspace clears.
Tap a square, then a number below the grid, or use the keyboard. Arrow keys move, digits enter, backspace erases and Enter runs the selected action. Your entries are white; solver entries are coloured. Editing or changing rules clears the solver entries. Contradicting squares turn red. Fill every empty square at once, and say how many solutions the grid has.
Three grids and what comes back
- solved, one solution
- solved, more than one solution
- no solution: R1C1 and R7C1 both hold 5
Common questions
- How do I enter a Sudoku puzzle?
- Select a square and enter a digit with your keyboard or the number buttons below the grid. Arrow keys move, backspace erases and Enter runs the selected action. For text input, choose Paste 81 characters, use 1 to 9 for givens and a dot, zero or underscore for blanks, then press Fill grid. Spaces and line breaks are ignored. An invalid character or length is refused with a specific error.
- How do I solve a Sudoku step by step?
- Choose Step, then press Next square. A naked single has only one legal candidate; a hidden single is the only place for a missing digit in a row, column, box or selected diagonal. When neither is available in a puzzle with one solution, a labelled search deduction proves a digit by checking all possible completions. Each press fills one square and highlights it. This does not claim to teach every named human technique, such as X-wing.
- Can it solve hard or extreme Sudoku puzzles?
- The solver uses backtracking rather than a difficulty limit, so it can finish a valid classic or X Sudoku even when singles do not finish it. Solve all fills the grid at once; Step uses an exhaustive search proof where needed. A contradictory or impossible puzzle is reported as having no solution.
- What does more than one solution mean?
- Two or more completed grids fit the givens and selected rules. Solve all displays one possible completion and stops counting after the second. Step can still fill a forced single, but if none exists it asks you to check for a missing given instead of choosing an arbitrary answer.
- Which Sudoku solver algorithm is used?
- The algorithm is backtracking with minimum remaining values. Record the digits used in every row, column and box, plus both main diagonals for X Sudoku. Find the empty square with the fewest legal candidates. Try a candidate, update those units and repeat. If a square has no candidate, undo the choice and try another; if all squares are filled, record a solution. Continue until the search is exhausted or two solutions have been found. Bitmasks store the used digits. This describes the algorithm; it is not a Python, Java, Excel or other language code generator.
- Does a Sudoku need at least 17 givens?
- A classic 9×9 Sudoku needs at least 17 givens to have exactly one solution. McGuire, Tugemann and Civario proved the absence of a unique 16-given classic puzzle by an exhaustive search published in 2012. That minimum does not apply to X Sudoku because the diagonals supply extra restrictions. The tool counts completions directly under the selected rules.
- Can I play a puzzle and check my own solution?
- Yes. Load the newspaper example with Try it, or enter your own puzzle, then choose Check mine and fill the remaining squares yourself. Check grid names conflicting entries, confirms a finished grid, or checks that a partial grid can still be completed. You can switch to Step for a hint or Solve all to see an answer. This page does not generate a new or daily puzzle.
- Which grid sizes and variants are supported?
- The board is 9×9 with 3×3 boxes. Classic Sudoku checks rows, columns and boxes. X Sudoku also requires 1 to 9 on each of the two main diagonals. A literal 3×3, 4×4, 6×6, 16×16 or 25×25 board is not supported, and Killer cages, jigsaw regions, samurai overlaps and letter grids need different rules.
- Can I solve a Sudoku from a photo or scan?
- This page accepts typed digits and text grids. It does not read images, camera pictures, scans or PDF files. A pasted puzzle must contain 81 digits or blank markers.
- Is my puzzle uploaded or saved?
- The search and grid stay in this browser. Progress is saved locally after you edit it, with a separate draft for each solver page. Opening the Step or X Sudoku page leaves the main page draft alone. The page's Start over button forgets these drafts. Copy grid writes nine lines of nine characters, which the text input can read back.
Exact: the answer satisfies every row, column and box, or the tool says the puzzle has none. It counts solutions as it searches, so it can tell you when a grid has more than one, and it cannot know which of those the puzzle author intended.