Free tool

Masyu Solver

Stuck on a Masyu from a book, newspaper or app? Recreate it here and the solver finds the loop — and tells you whether the puzzle has a unique solution.

Click cells to place pearls, then press Solve.

How the Masyu solver works

The solver models every edge between neighbouring cells as line, no line or unknown. It repeatedly applies the Masyu rules — degree constraints (each cell has 0 or 2 lines), the black and white pearl rules, and the no-premature-loop rule — the same deductions described in our strategy guide. When logic alone stalls, it tries both options for an edge and backtracks on contradictions, stopping once it has found two different solutions (which proves the puzzle isn’t unique).

Solving Masyu in general is NP-complete, so extremely large or very sparse custom grids may take longer; puzzles from books and apps typically solve in well under a second.