Sudoku Solver

Upload Sudoku Image

Upload an unsolved sudoku image from your device. Once your photo is uploaded, click the "Solve" button to get the fully solved image. If you do not wish to upload your own, you may use the default image provided below.
Please allow 30 seconds for my solution API server to populate the solved board. This cloud compute instance is free with only 1/8th of an OCPU and 1GB of memory.

Sudoku Solver Details

The program was designed to solve any Sudoku puzzle in the following high-level steps.
  1. Accepts a sudoku image as input
  2. Identifies the board space by mapping the image to black and white, creating a numpy array, and exploring the array recording the total area of the board
  3. Crops the original image to only show the straightened and rotated board image based on the previously determined board area
  4. Identifies all squares where numbers are present and not present and stores the data in an array
  5. All squares with numbers present are compared against the training data and number with best match score is selected
  6. Sends the unsolved array to the sudoku solver algorithm that incorporates a backtracking solving method for more complex puzzles and returns the solved board array
  7. Uses the solved array to place the solution numbers in their respective positions on the uploaded board
  8. A board complete with the solved numbers in red print presented to the user

Test Samples

Below are a number of test puzzles and generated solutions used to test the ability of the solver.
Test Case 1: Easy Puzzle
Test Case 2: Medium Puzzle
Test Case 3: Difficult Puzzle Left Rotation
Test Case 4: Difficult Puzzle Right Rotation
Test Case 5: World's Hardest Sudoku