Minesweeper
Classic minesweeper — clear cells using number hints.
Time: 0:00
Recent (up to 5)
No records yet — clear a board!
What is this?
Minesweeper is a puzzle where you open every safe cell on a grid while avoiding hidden mines. Numbers on opened cells tell you how many mines are among the 8 surrounding cells — use them to deduce mine locations.
How to play
Pick a difficulty (beginner, intermediate, expert), then click cells to open them. Your first click is always safe — mines are placed only after it. Opening a blank cell with no adjacent mines automatically cascades open its neighboring blank cells. Right-click (or long-press on mobile) to toggle a flag on a suspected mine so it can't be opened by accident. Clicking a mine ends the game immediately and reveals all mines; opening every non-mine cell wins.
Privacy
Your best record (fastest clear time) per difficulty is stored only in your browser (localStorage) and is never sent to a server or shared across devices.
The first-click-safe rule — how this implementation actually works
This tool places mines only after your first click lands. In the code, mine positions are drawn at random from every cell except the one you just clicked, so the cell you open first can never be a mine. What it does not do is the more generous variant that also guarantees the 8 neighboring cells are mine-free, which forces a large open area on the very first move. So it's entirely possible for a mine to sit right next to your first opened cell, leaving you with just a number to work from. That's barely noticeable on low-density Beginner (9×9, 10 mines), but on high-density Expert (16×30, 99 mines) it's common to start with nothing but a numeric hint.
Basic number-deduction patterns — a worked "1-2-1" example
Each number tells you how many mines sit among its 8 neighboring cells, and combining several numbers lets you deduce definitely-safe or definitely-mined cells through a handful of recurring patterns. The best-known is the "1-2-1" pattern: when three cells in a row read 1, 2, 1, and four unopened cells run alongside them, the two outer cells are guaranteed mines and the two middle cells are guaranteed safe. This works because each number's constraint — exactly that many mines among its unopened neighbors — has to hold simultaneously across all three numbers. Two simpler rules go a long way too: if a "1" has only one unopened neighbor, that neighbor is a certain mine; and if a number's count already matches its adjacent flags, every other unopened neighbor is certainly safe. Applying both consistently extends how far you can progress without guessing.