Minesweeper Solver
How to use the minesweeper solver
Choose the board size and enter how many mines it has. Then copy your board in: pick a number from the row of buttons and tap or drag over the squares that show it, use 0 for an opened square with no number, and the flag for mines you have marked. Leave unopened squares as they are; the grey button turns a square back into an unopened one. The solver updates as you go: a tick means the square is safe to open, a star means it is certainly a mine, and every other unopened square shows its exact chance of hiding a mine. When nothing is certain, the best guess is outlined.
It works for minesweeper anywhere, including the versions inside other games, as long as the numbers count the eight squares around them.
How it works out the odds
Every arrangement of mines that agrees with every number on the board is equally likely, so the chance a square hides a mine is the share of those arrangements that put one there. The solver counts them exactly. The unopened squares next to numbers split into groups that share no number, and each group's arrangements are listed one by one. The squares away from every number all have the same odds, and how many mines are left for them, out of the total, decides how much each border arrangement counts. That is why the mine count matters: without it, those squares cannot be given odds at all.
A square marked safe is safe in every arrangement that fits, not just likely to be. Before this page went up its odds were compared with brute force, every possible placement of the mines counted on 109 small boards, and agreed on every square; on 60 full-size beginner, intermediate and expert games, it never called a mine safe or a safe square a mine.
Minesweeper patterns worth knowing
1-1 against a wall: two 1s side by side along an edge share a mine, so the square beyond the second 1 is safe. 1-2-1: the mines are under the two 1s, and the square under the 2 is safe. 1-2-2-1: the mines are under the two 2s. These patterns are just the counting above done in your head, and when none of them applies, the odds tell you which square is the least risky to try.
More logic puzzles
To play, there is a new daily minesweeper every day. The nonogram solver and the sudoku solver explain their reasoning step by step. For puzzles with no luck in them at all, our brain teasers are made of wood and metal. There are more solvers on the puzzle tools page.
Frequently Asked Questions
How does a minesweeper solver work?
It looks at every arrangement of mines that agrees with all the numbers on the board. A square with no mine in any of them is safe, one with a mine in all of them is a mine, and for the rest the share of arrangements with a mine there is the exact chance.
Is there always a safe move in minesweeper?
No. Sometimes every unopened square has some chance of a mine, typically in a 50-50 at the end of a game. The solver then outlines the square with the lowest odds.
What is the 1-2-1 pattern in minesweeper?
Three numbers 1, 2, 1 in a row along unopened squares: the mines are under the two 1s, and the square under the 2 is safe. With 1, 2, 2, 1 the mines are under the two 2s.
Why does the solver need the number of mines?
Squares that touch no number can only be given odds if you know how many mines are left for them. Without the count the solver still finds every certain safe square and mine next to the numbers.
Can I use it for minesweeper in other games?
Yes, for any version where a number counts the mines in the eight squares around it. Set the board size, copy the numbers in by hand, and enter the mine count if the game shows it.