Enter the known digits of a standard 9x9 Sudoku, then choose Solve puzzle to complete the grid. The example is ready to use when the page opens, so the solver can be tried immediately. Reveal one cell provides a smaller hint without filling the whole board, while Clear board starts a new puzzle. All calculations run locally in the browser.
How the Online Sudoku Solver Works
A valid Sudoku solution places the digits 1 through 9 exactly once in every row, every column, and every 3x3 box. The solver first checks the entered clues against those constraints. Duplicate clues are rejected before the search begins, which avoids spending time on a puzzle that cannot possibly have a valid completion.
Empty cells are represented by nine-bit candidate masks. If a row already contains 2, 5, and 8, the corresponding bits are removed from every empty cell in that row; column and box masks remove further candidates. This compact representation makes each validity check a handful of bitwise operations rather than repeated scans through the complete grid.
Why Difficult Puzzles Finish Quickly
Plain backtracking fills the first empty square, tries every digit, and may follow millions of unproductive branches before noticing a contradiction. This implementation uses the minimum-remaining-values strategy: at each step it selects the empty cell with the fewest legal candidates. A forced cell is handled immediately, while a two-candidate cell is considered before a cell with six possibilities. Contradictions therefore appear close to the branch that caused them.
A fixed search budget is also enforced. It is a final safeguard against malformed or unusually underconstrained inputs monopolizing the browser. Standard newspaper Sudoku puzzles, including difficult examples, normally finish far below that limit. If the budget is reached, the original clues remain unchanged and the tool reports the problem instead of leaving the page apparently frozen.
Reading the Result
Original clues remain visually distinct from generated digits. The solver returns one valid completion; it does not claim that the puzzle has exactly one solution. A Sudoku with too few clues may permit several completions, in which case the displayed grid is one of them. For puzzle construction or formal verification, uniqueness requires a second search that deliberately excludes the first solution.
Example Puzzle
The preloaded grid is a classic medium-difficulty Sudoku. Try revealing one cell first and continue manually, or solve the complete puzzle to compare your result. Digits can be replaced directly in the grid, making the example a convenient starting point for testing how a changed clue affects solvability.