Sudoku Solver
Free online sudoku solver tool, no installation required
About Sudoku Solver
A 9x9 Sudoku solver and puzzle generator that runs entirely in your browser. You can type any Sudoku puzzle into the grid (entering a digit 1-9 or leaving a cell blank for empty), or have the tool generate a fresh puzzle for you. When you click Solve, it applies a backtracking algorithm to find a valid completion and renders the solution inline, tinting cells so you can distinguish the digits it filled from the ones you provided.
How to Use
1. Click any of the 81 cells to select it (it gets a primary-colored ring), then type a single digit 1-9 — empty it by clearing the character; the input uses numeric mode and a maxLength of 1. 2. Click Load Example to populate the grid with a known solvable puzzle, or Generate to create a random puzzle by filling the diagonal 3x3 boxes and then removing 40 digits. 3. Click Solve to compute the solution; the grid becomes read-only and inserted digits are tinted blue or green so you can distinguish them from your givens. 4. Click Clear to empty all cells and start over.
Solving Algorithm
The solver uses recursive backtracking: it locates the first empty cell (scanning top-to-bottom, left-to-right via findEmptySpot), tries digits 1 through 9, validates each candidate against its row, column, and 3x3 box with isValidMove, and recurses. On a dead-end it resets the cell to 0 and backtracks. Generation works by first filling the three diagonal 3x3 boxes (which are mutually independent), solving the rest to produce a complete board, then removing 40 random cells. There is no uniqueness check on the generated puzzle — only that the original full solution satisfies it.
▶What happens if I enter an unsolvable or contradictory puzzle?
▶Does the generated puzzle always have a unique solution?
▶Can I edit the grid after solving?
▶Is my data sent to a server?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee