← Thasanka Kandage

AI Sudoku Solver

Upload a photo of a Sudoku puzzle. It finds the grid, reads the digits with a CNN I trained, and solves the rest by backtracking. Source.

Choose a Sudoku image. Note that since I am using Render, it may take 1-2 minutes for my instance to spin up after inactivity.

Your image.
The solved puzzle.

How it works

  1. We clean the photo so the puzzle is easy to see.
  2. Finds the puzzle border and straightens the grid.
  3. Each cell is extracted and the digit (if any) is read by the model.
  4. Low-confidence reads are treated as empty so mistakes don't break the solve.
  5. The solver fills in the missing numbers and stops if the puzzle is invalid.
  6. The completed numbers are drawn back onto your photo.