Online Minesweeper - Play Classic Mine Sweeper Game Free
Play Minesweeper online for free. Classic mine sweeper with Beginner, Intermediate, Expert difficulty levels and custom board. Track your best times.
About
Minesweeper is a single-player logic puzzle where the objective is to clear a rectangular grid of cells without detonating any hidden mines. Each revealed cell displays a number n indicating how many of its 8 orthogonal and diagonal neighbors contain mines. A cell showing 0 triggers a flood-fill cascade that reveals all connected safe cells. The game is NP-complete in the general case, meaning certain board configurations require probabilistic reasoning rather than pure deduction. Incorrect deduction on an Expert-level board (99 mines on a 30×16 grid, mine density ≈ 20.6%) leads to immediate loss. This implementation guarantees a safe first click by excluding the selected cell and its neighbors from mine placement.
The tool tracks completion times per difficulty tier using performance.now() with millisecond resolution. World-record territory for Expert is under 30 seconds. Pro tip: learn to chord (reveal all unflagged neighbors when the correct flag count surrounds a number) to dramatically reduce click count. Note: boards with density above 35% frequently produce unsolvable configurations requiring guesses.
Formulas
Adjacent mine count for cell at position (r, c):
n(r, c) = ∑(dr,dc) ∈ N8 M(r + dr, c + dc)
where M(i, j) = 1 if cell contains a mine, 0 otherwise, and N8 = {(−1,−1), (−1,0), (−1,1), (0,−1), (0,1), (1,−1), (1,0), (1,1)}.
Mine density:
ρ = mcols × rows × 100%
Flood-fill condition: cell (r, c) is added to the BFS queue if n(r, c) = 0 ∧ cell is unrevealed ∧ cell is unflagged.
Win condition: number of revealed cells = (cols × rows) − m
where m = total mine count, r = row index, c = column index, ρ = mine density.
Reference Data
| Difficulty | Columns | Rows | Mines | Density | Avg. Solve Time | World Record |
|---|---|---|---|---|---|---|
| Beginner | 9 | 9 | 10 | 12.3% | 10 - 30s | 0.49s |
| Intermediate | 16 | 16 | 40 | 15.6% | 40 - 120s | 7.03s |
| Expert | 30 | 16 | 99 | 20.6% | 120 - 600s | 23.42s |
| Custom (min) | 5 | 5 | 1 | 4.0% | - | - |
| Custom (max) | 50 | 50 | 999 | Varies | - | - |
| Number Colors by Adjacent Count | ||||||
| 1 | Blue - #0000FF | |||||
| 2 | Green - #008000 | |||||
| 3 | Red - #FF0000 | |||||
| 4 | Dark Blue - #000080 | |||||
| 5 | Maroon - #800000 | |||||
| 6 | Teal - #008080 | |||||
| 7 | Black - #000000 | |||||
| 8 | Gray - #808080 | |||||