Tool/Solver to resolve sudoku/wordoku grids (directly or step by step). The aim of the sudoku game is to fill the rows and columns of a 9x9 grid with each digit only once.
Sudoku Solver - dCode
Tag(s) : Number Games
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Sudoku is a logic puzzle consisting of filling a 9x9 grid with the digits 1 through 9. Each digit must appear exactly once in each row, each column, and each of the nine 3x3 blocks.
Variations exist with different grid sizes or with symbols (letters, icons). The mathematical structure remains the same: it is a constraint satisfaction problem where each symbol must adhere to local uniqueness rules.
The grid can be filled by copying and pasting a sequence of 81 characters (numbers or symbols), or by directly entering the values into the cells.
The numbers $ 1 $ to $ 9 $ are accepted. For Wordoku-style variants, letters can also be used, provided that 9 distinct symbols are employed.
Example: Copy the Sudoku content in the first cell (top left) 97 1 5 5 9 2 18 4 8 7 26 92 3 6 2 9 19 4572 to get:
| 9 | 7 | ␣ | 1 | ␣ | ␣ | ␣ | ␣ | 5 |
| ␣ | ␣ | 5 | ␣ | 9 | ␣ | 2 | ␣ | 1 |
| 8 | ␣ | ␣ | ␣ | 4 | ␣ | ␣ | ␣ | ␣ |
| ␣ | ␣ | ␣ | ␣ | 8 | ␣ | ␣ | ␣ | ␣ |
| ␣ | ␣ | ␣ | 7 | ␣ | ␣ | ␣ | ␣ | ␣ |
| ␣ | ␣ | ␣ | ␣ | 2 | 6 | ␣ | ␣ | 9 |
| 2 | ␣ | ␣ | 3 | ␣ | ␣ | ␣ | ␣ | 6 |
| ␣ | ␣ | ␣ | 2 | ␣ | ␣ | 9 | ␣ | ␣ |
| ␣ | ␣ | 1 | 9 | ␣ | 4 | 5 | 7 | 2 |
The program solves 9x9 Sudoku puzzles like a human would, by combining logical deductions.
— Candidate calculation: For each empty cell, dCode determines the set of possible values compatible with the row, column, and block constraints.
— Only possible value: If a cell has only one candidate, that value is validated.
— Only possible cell: If, for a given number, only one cell in a row, column, or block can contain it, that value is validated.
When no further direct deductions are possible, the solver uses backtracking. It selects a cell with a minimal number of candidates, tests a value, and then continues the deductions. If there is an inconsistency (no solution), it goes back and tries another value. The choice is not random: it relies on heuristics designed to reduce the search tree and speed up the solution. This method is the fastest for the solver; it is possible that sometimes a slower, complex deduction could achieve the same result.
In a standard 9x9 grid, a block (also called a region, group, sector, or subgrid) is a 3x3 square. There are 9 blocks in total.
dCode calculates all the solutions for the sudoku, not only the first one. To check a homemade sudoku, the solver can confirm that there is only one solution.
The modern form of Sudoku was published in 1979 by Howard Garns in the American magazine Dell under the name Number Place.
The game was later popularized in Japan in the 1980s by the Nikoli company, which named it Sudoku, a contraction of Sūji wa dokushin ni kagiru, meaning numbers must remain unique.
A single row can consist of $ 9! $ (Factorial of 9) different ways, same for the columns, but the whole sudoku has a number of possibilities much less than $ 9!^9 $, because some permutations can lead to identical grids. The total number of grids is $ 9! \times 72^2 \times 2^7 \times 27704267971 = 6670903752021072936960 $ combinations (result demonstrated in 2005).
For a sudoku to have only one solution, it must have at least 17 pre-filled boxes out of the 81 total. Gary McGuire and his team proved this here by using an algorithm to perform a systematic computer search. They first cataloged the 5,472,730,530 distinct sudoku puzzles. Next, they created a program to check whether sudoku puzzles with 16 pre-filled squares had a unique solution. Their exhaustive search found no sudoku with only 16 pre-filled squares having a unique solution, thus confirming the minimum number of 17 pre-filled squares needed.
By keeping the sudoku NxN rules that require the N characters to be used on each row and column, then it is impossible to respect them if the sudoku is not square.
Some variants of the square sudoku, however, use non-square inner blocks (see sudoku 6x6, sudoku 7x7 or sudoku 8x8)
dCode retains ownership of the "Sudoku Solver" source code. Any algorithm for the "Sudoku Solver" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Sudoku Solver" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Sudoku Solver" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Sudoku Solver" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Sudoku Solver on dCode.fr [online website], retrieved on 2026-03-11,