Skip to content
MoneyDeck

Sudoku Solver

Paste any 9×9 sudoku and get the solution with logical steps

Updated · Free, no signup

Paste 81 cells in reading order. Digits 1–9 are givens; . 0 _ * or ? mean empty. Other characters are ignored.

Solved grid

5 3 4 | 6 7 8 | 9 1 2
6 7 2 | 1 9 5 | 3 4 8
1 9 8 | 3 4 2 | 5 6 7
------+-------+------
8 5 9 | 7 6 1 | 4 2 3
4 2 6 | 8 5 3 | 7 9 1
7 1 3 | 9 2 4 | 8 5 6
------+-------+------
9 6 1 | 5 3 7 | 2 8 4
2 8 7 | 4 1 9 | 6 3 5
3 4 5 | 2 8 6 | 1 7 9

Status

Solved — unique solution

Solution as one line

534678912672195348198342567859761423426853791713924856961537284287419635345286179

Givens (clues)

30

Cells filled by singles

51

Search steps (incl. uniqueness check)

0

Solutions found

1
  • Solved entirely with naked and hidden singles — 51 logical placements, no guessing needed.

Logical solving steps

StepCellDigitReason
1R5C55Naked single — the only digit left for this cell
2R6C49Naked single — the only digit left for this cell
3R7C53Naked single — the only digit left for this cell
4R7C67Naked single — the only digit left for this cell
5R7C94Naked single — the only digit left for this cell
6R8C83Naked single — the only digit left for this cell
7R2C73Hidden single — the only place for 3 in row 2
8R2C98Hidden single — the only place for 8 in row 2
9R3C43Hidden single — the only place for 3 in row 3
10R3C75Hidden single — the only place for 5 in row 3
11R3C97Hidden single — the only place for 7 in row 3
12R5C36Hidden single — the only place for 6 in row 5
13R5C77Hidden single — the only place for 7 in row 5
14R5C89Hidden single — the only place for 9 in row 5
15R6C33Hidden single — the only place for 3 in row 6

About the Sudoku Solver

This sudoku solver finishes any standard 9×9 puzzle. Type or paste the grid row by row — digits for the givens and a dot or 0 for each empty cell — and it returns the completed grid, the solution as one 81-digit line, and a step-by-step list of the cells it could fill by pure logic. Spaces, line breaks and grid lines such as | or + are ignored, so you can paste puzzles from most websites and apps.

Use it to check your answer, get unstuck on a hard newspaper puzzle by looking at just the next logical step, verify that a puzzle you created has exactly one solution, or find mistakes: if two equal digits share a row, column or box, it names them instead of guessing.

The solver first applies the two techniques human solvers use most — naked singles and hidden singles — and records each placement. When a puzzle needs harder techniques, it completes the grid with a fast backtracking search and tells you how many guesses that took, then keeps searching for a second solution to confirm the puzzle is unique.

How to use the sudoku solver

  1. 1Type or paste the puzzle row by row, using . or 0 for each empty square.
  2. 2Make sure there are exactly 81 cells — grid lines and spaces are ignored.
  3. 3Read the solved grid, or copy the 81-digit solution line.
  4. 4Stuck? Look at just the first few rows of the logical steps table for a hint.
  5. 5Check the status to see whether the puzzle has one solution, several or none.

Formula and method

Candidates(cell) = {1…9} − digits already in its row, column and 3×3 box

Every empty cell starts with the candidates 1 to 9, minus any digit already used in the same row, column or box. A naked single is a cell with only one candidate left; a hidden single is a digit that can go in only one cell of a row, column or box. The solver repeats these two rules until no more cells can be filled, logging each placement as a step.

If cells remain, it uses depth-first backtracking: it picks the empty cell with the fewest candidates, tries each one, and backs up whenever a cell runs out of options. It continues after the first solution to look for a second, which tells you whether the puzzle is unique. Searches are capped at 200,000 steps, far more than any published 9×9 puzzle needs.

R#C#
Row and column of a cell, counted from the top-left (R1C1)
Box
One of the nine 3×3 blocks, numbered left to right, top to bottom

Worked examples

Classic puzzle (30 clues)

The default grid is a well-known 30-clue puzzle. Naked and hidden singles alone complete it, and the search confirms there is no second solution, so the status reads “unique solution”. The first row resolves to 5 3 4 6 7 8 9 1 2.

Typo with two 5s in the first row

The third cell was entered as 5, but row 1 already has a 5 in the first cell. The solver stops and names the conflict instead of producing a wrong answer.

Puzzle with too few clues

With only the first row filled, there are many valid grids. The solver shows one completion and reports that at least two solutions exist, so this is not a proper sudoku.

Frequently asked questions

How do I enter a sudoku puzzle?+

Type the 81 cells row by row, left to right. Use digits 1–9 for given numbers and a dot (.) or zero (0) for blanks. You can put each row on its own line and include spaces or grid lines; they are ignored.

Can every sudoku be solved?+

Every valid sudoku can. This solver finds a solution for any grid that has one and tells you when the givens contain a duplicate or lead to a contradiction, which usually means a typo in the puzzle.

What is the minimum number of clues for a sudoku?+

A 9×9 sudoku with a unique solution needs at least 17 clues. This was proved by an exhaustive computer search published in 2012, so any puzzle with 16 or fewer givens has more than one solution.

What are naked singles and hidden singles?+

A naked single is a cell where only one digit is still possible. A hidden single is a digit that has only one possible cell left in a row, column or box. Together they solve most easy and medium puzzles.

Why does the solver say it needed search steps?+

Hard and expert puzzles need techniques beyond singles, such as pairs, X-wings or chains. Rather than list every technique, the solver finishes those cells with a quick backtracking search and reports how many steps it took.

How can I use it for a hint without spoiling the puzzle?+

Look only at the first rows of the logical steps table. Each row tells you one cell, its digit and the reason, so you can take a single step and carry on solving yourself.

Related tools