Sudoku Solver & Auto-Answer

A browser-based Sudoku tool featuring auto-generated boards for Play mode and a Solver mode using backtracking search. There is no guarantee that any inputted layout can be solved, and complex boards may take time. It includes basic contradiction and solution count checks.

Loading tool interface...

When to use this tool

Back to the tool ↑

Play Sudoku or search for a solution to a board you enter.

Try it first

Start a puzzle in Play mode, select a blank cell, and enter a number. Compare your entry with the fixed clues.

Before you start

Enter the givens carefully when solving your own board. A contradictory board has no solution.

Local Browser Processing and Network Communication Notice

This tool's processing operates locally within your browser. Standard site assets, analytics, and advertisements may communicate separately. There are no guarantees.

ZeroTools: Browser Processing & Privacy

ZeroTools focuses on tools that process input on your device. Check each tool’s scope and limitations before use.

Processing and privacy policy
Chapter 1

Two Board Modes

The tool provides two distinct operational environments: a Play mode dedicated to manually solving generated puzzles, and a Solver mode focused on inputting, analyzing, and solving custom grid layouts.

Ordinary tab switching resets or generates layouts as described: clicking the Play tab directly or triggering puzzle generation follows standard generator behavior by producing a fresh layout, while adjusting difficulty settings regenerates the puzzle only in Play mode.

Conversely, switching into the Solver tab clears the active grid back to an empty board, terminating any ongoing algorithmic search animations.

However, invoking the explicit "Play This Puzzle" command is an exception that retains the imported custom board rather than generating a new layout.

Rather than claiming all switches uniformly reset or retain state, uncommitted inputs and solver animations do not persist across ordinary tab switches, whereas the explicit puzzle transition preserves the custom layout.

In Play mode, pressing the "Generate New Puzzle" button instantly creates a puzzle in your browser by randomly emptying a specific number of cells from a completed 9x9 Sudoku grid.

In this mode, you use the keypad or keyboard to fill in the blanks yourself, and a clear screen appears when all cells are correctly populated.

Solver mode enables manual digit entry into an 81-cell grid to inspect custom layouts, highlighting row, column, and block conflicts in red to prevent invalid solving attempts.

To play an entered puzzle, an explicit action transfers the configuration into Play mode by setting a one-time generation-skip reference, retaining the current 81 cell values while locking existing entries as starting clues.

The interface enables this transfer only when the puzzle has been analyzed, contains at least 17 givens, has been verified to possess exactly one unique solution, and is not actively running a solver routine.

Note that bulk import validation is not strictly enforced, nor are all background solver race conditions completely resolved.

Chapter 2

Numbers and Candidate Notes

The input interface for the board supports both mouse operations using the on-screen keypad and direct keyboard input. Keyboard operations allow entering values with number keys 1 through 9, moving the selected cell with arrow keys, and clearing the cell using the 0, Backspace, or Delete keys.

Additionally, entering the same number as the currently selected cell acts as a toggle, returning that cell to an empty state. Be aware that keyboard events might interfere with dialog targets since they are not strictly excluded.

There are two input methods available: "Normal Input" and "Note Input." Normal input mode places a single finalized digit in a cell.

Conversely, Note input mode, available exclusively in Play mode, allows you to record multiple candidate numbers from 1 to 9 within a single cell.

You can quickly switch this input mode by pressing the "N" key on your keyboard or clicking the button on the screen. In Note input mode, entered numbers are displayed as tiny characters inside the cell.

You cannot overwrite, clear, or add notes to the fixed cells already placed as the initial puzzle in Play mode. Internally, the tool maintains the initial board state as a two-dimensional array separate from the board state editable by the user.

This allows you to restore the board to its original puzzle state at any time using the "Reset to Initial" button.

Chapter 3

81-Character Bulk Input Rules

To save you the trouble of manually entering numbers one cell at a time in Solver mode, a bulk board import function via text copy-and-paste is implemented.

This feature parses Sudoku puzzle data expressed as a text string and expands it onto the 9x9 grid.

When text is entered into the bulk input dialog, delimiters such as line breaks, blank spaces, and commas are first stripped away using regular expressions.

The "." (period), commonly used to represent empty Sudoku cells, is replaced with the internal representation "0". The characters are then evaluated sequentially from the beginning; digits from 0 to 9 are adopted as is, while any other symbols or letters are entirely treated as empty cells (0).

After removing separators, this processing uses the first 81 character positions of the string; unknown characters are treated as 0 and consume one position.

If there are fewer than 81 characters, missing cells are padded with 0s to the end, while data from the 82nd character onward is truncated.

The resulting 81 digits are split into 9x9 segments for the initial board in Solver mode. All processing occurs entirely within the browser.

Chapter 4

Backtracking and Steps

The automatic solving algorithm in this tool utilizes "backtracking," a type of depth-first search. The exploration process begins at the top-left cell of the board and sequentially searches for empty cells moving towards the bottom-right.

When an empty cell is found, it temporarily places numbers 1 through 9 in order, checking if that number violates any row, column, or 3x3 block constraints.

If there is no violation, it proceeds to the next empty cell; if placing any number results in a constraint violation (a contradiction occurs), it returns to the previously filled cell (backtracks) and attempts a different candidate number.

By repeating this process, it eventually fills all cells while satisfying the constraints, or proves that no valid combination exists.

The displayed trial steps count the cumulative operations of temporarily placing and removing numbers; they do not represent human logical steps.

A generator yields the board state for animation, Pause, and Resume, with intervals of 150ms, 50ms, 10ms, or 1ms. Solve Instantly uses direct recursion in the same order without animation or execution time guarantees.

Reset or Clear may reset the display to 0 while leaving internal counts, and editing after Paused may resume old searches. Always end the search with Reset or Clear before re-entering.

Chapter 5

Contradictions and Solution Counts

Solver mode incorporates a function that performs real-time analysis on the inputted board to determine its validity as a puzzle.

This determination consists of three stages: checking for placement contradictions, verifying the clue count, and counting the number of possible solutions.

First, the moment a user inputs a number, the board is scanned for obvious constraint violations (duplicate numbers within the same row, column, or block).

If duplicates exist, it triggers an error state as "Unanalyzable." Next, it calculates the total number of inputted numbers (clues).

Because it is established that a Sudoku puzzle requires at least 17 clues to possess a unique solution, a warning message indicates that the solution will not be unique if there are fewer than 17 clues.

Note that 17 clues are necessary but not sufficient for uniqueness.

If there are no contradictions and 17 or more clues exist, the tool executes a solution search on the main browser thread in response to input changes.

Here, it applies the standard backtracking search, but instead of stopping after finding one solution, it counts up to a maximum of two solutions.

It returns a status of "Placement error (no solution)" for a count of 0, "Unique solution exists" for 1, and aborts the search at 2 to display "Multiple solutions exist." This allows for simple verification of custom puzzles.

Chapter 6

Generation Difficulty and Usage Limitations

Puzzle generation in Play mode employs a straightforward method of adjusting the number of blank cells based on the difficulty setting.

It creates puzzles by randomly hiding 40 cells for "Easy", 48 cells for "Medium", and 54 cells for "Hard" from a fully completed solution board.

Puzzles are generated by randomly removing cells from a completed board, ensuring at least 1 solution exists. Difficulty is adjusted by hidden cells: Easy 40, Medium 48, and Hard 54.

However, uniqueness and human-logical difficulty are not guaranteed. Because cells are removed randomly, a Hard puzzle might be easy if clues are straightforward, while an Easy puzzle might have multiple solutions and cannot be solved by logic alone.

The generator does not evaluate the necessity of specific solving techniques.

This tool does not support saving, OCR, human logical shortest paths, all-solutions enumeration, or Web Workers; board and notes are lost on reload or tab close.

The row-major depth-first search in ascending order can be heavy for difficult or unsolvable puzzles, potentially freezing the UI.

Editing or generating a new board while paused may resume old searches, so always end with Reset or Clear before re-entering. Note that keyboard inputs may also interfere with open dialogs.

Frequently Asked Questions (FAQ)

A.
It supports 81-character digit strings. After removing spaces, newlines, and commas, it treats . as 0 and uses the first 81 character positions. Unknown characters are also treated as 0 and consume one position. Missing characters are padded with 0, and excess text is truncated.
A.
Yes. In Solver mode, if there are 17 or more clues and no duplicates, it searches for up to two solutions in real-time and displays whether the puzzle has a unique solution, multiple solutions, or 0 solutions due to contradictions.
A.
You can select the exploration interval from 150ms, 50ms, 10ms, and 1ms. Solve Instantly is a synchronous process that skips animation, but it does not guarantee immediate completion or specific response times.
A.
Difficulty is adjusted by the number of hidden blank cells: 40 for Easy, 48 for Medium, and 54 for Hard. Since cells are removed from a completed board, at least one solution exists, but uniqueness and human-logical difficulty are not guaranteed.