Skip to content
Toolcroft

Sudoku Solver - Solve Puzzles and Check Uniqueness

Games & Puzzles

Solve a 9×9 sudoku puzzle online, check whether its solution is unique, and import or copy puzzle strings. All solving runs in your browser.

1
7
9
3
2
8
9
6
5
5
3
9
1
8
2
6
4
3
1
4
7
7
3
Import / export puzzle strings

Click a cell and type 1–9. Arrow keys / Tab to navigate. Blue digits are the solution.

How to use this tool

  1. Open Import / export puzzle strings and paste an 81-cell grid, or enter clues in the cells.
  2. Click any cell in the grid and type a digit 1–9 (or 0 / Backspace to clear).
  3. Use arrow keys or Tab to navigate between cells.
  4. Click Solve to find one solution and check whether the search finds alternatives.
  5. Use Copy puzzle or Copy solution to copy a normalized 81-digit string.
  6. Click Clear to reset the puzzle.

How the sudoku solver works

The solver uses a backtracking algorithm combined with the Minimum Remaining Values (MRV) heuristic. Instead of trying cells in order, it picks the empty cell with the fewest legal candidates. This usually narrows the search because a cell with only one or two options is considered before a cell with many options. The solver checks each candidate against the row, column, and 3×3 box rules, then backtracks when a choice leads to a dead end. All of this runs in your browser.

Sudoku rules

A standard 9×9 sudoku requires that every row, every column, and every 3×3 box contains each of the digits 1–9 exactly once. The puzzle starts with some cells pre-filled (the "givens"), and you must deduce the rest.

Tips for entering puzzles

You can type clues into the grid or open Import / export puzzle strings and paste an 81-cell representation. Use digits 1–9 for clues and 0, a period, an underscore, or a hyphen for an empty cell. Spaces, line breaks, and common row separators are ignored. After importing, the non-empty cells become the puzzle's givens; an invalid length or character is rejected without replacing the current grid. Copy puzzle and Copy solution produce normalized strings containing exactly 81 digits, with zeroes for blanks.

  • Click a cell and type the digit. Use Backspace or 0 to clear.
  • Navigate with Arrow keys or Tab / Shift+Tab.
  • Click Load Example to try Al Escargot, rated one of the hardest ever published.

Try to solve it yourself first

This solver searches with backtracking; it does not mimic human logic or explain individual deductions. If you're working through a puzzle to improve your skills, attempt it yourself before using the solver. Use the solver to check your answer or get unstuck, while remembering that a completed grid does not teach the technique that leads to each placement.

Solution counts, conflicts, and search limits

The result explains what the search was able to establish:

  • Unique solution: exhaustive search finds one completion and no alternatives.
  • Multiple solutions: the solver finds at least two completions, displays one, and labels the puzzle as having multiple solutions.
  • Conflicting clues: duplicate digits in a row, column, or 3×3 box are reported before the search begins.
  • No solution: when clues do not directly conflict, the solver reports no solution only after it exhausts all possible completions.
  • Unknown: a two-million-node safety cap can stop a difficult search. If that happens before the result is definitive, the tool says the answer or uniqueness is unknown instead of claiming the puzzle is impossible or unique.

Step-by-step solving mode

The current solver reveals the full solution at once. A step-by-step mode - which shows one logical deduction at a time with an explanation of which technique was applied - would be far more educational for players learning to solve harder puzzles. This remains a potential future enhancement; the current tool displays a completion and reports whether its search found one or multiple solutions, but it does not provide human-technique hints.

Frequently asked questions

What algorithm does the solver use?

The solver uses a backtracking algorithm with the Minimum Remaining Values (MRV) heuristic. It picks the empty cell with the fewest possible valid digits at each step, dramatically reducing the search space for hard puzzles.

Can it solve Al Escargot?

The solver uses MRV backtracking and includes Al Escargot as an example. Search time depends on the puzzle and device; the safety limit can stop unusually large searches before uniqueness is known.

How does the solver report multiple solutions?

It searches for up to two completions. If it finds two, it reports multiple solutions and displays one. If it exhausts the search after finding one, it reports a unique solution. If the safety limit is reached first, it reports that uniqueness is unknown.

What if my puzzle has no solution?

Duplicate clues in a row, column, or box are reported as conflicts. Otherwise, the solver reports no solution only after it has exhausted the search. If its safety limit interrupts that search, it reports uncertainty instead.

Can I paste and copy a puzzle?

Yes. Import an 81-cell string using digits 1–9 and 0, period, underscore, or hyphen for blanks. Whitespace and row separators are accepted. Copy puzzle and Copy solution place normalized 81-digit strings on your clipboard.

Does the solver work offline?

Yes. The solver is implemented entirely in JavaScript and runs in your browser with no server calls.

Browse all games & puzzles