GamesStrategy Guide

How to Play Minesweeper: Rules, Patterns, and Strategy

From your very first click to reading complex number patterns — a complete guide to clearing the board with logic rather than luck.

The Rules of Minesweeper

Minesweeper is a single-player logic puzzle played on a rectangular grid of hidden cells. A fixed number of mines are concealed somewhere on that grid. Your goal is to reveal every cell that does not contain a mine without ever clicking on one. The moment you click a mine, the game ends immediately and all remaining mines are exposed so you can see where they were hiding.

There are three types of cells you will encounter as you play:

  • Blank cells — a revealed cell that shows no number. This means none of its eight neighbours contain a mine. Clicking a blank cell triggers an automatic flood-fill that opens all connected blank cells at once, clearing large safe regions in a single move.
  • Numbered cells — a revealed cell showing a digit between 1 and 8. The number tells you exactly how many of the eight surrounding cells contain mines. This is your primary source of information for deduction.
  • Flagged cells — an unrevealed cell you have right-clicked to mark with a flag icon. Flags do not reveal the cell; they simply mark it as a suspected mine so you do not accidentally click it.

You win by revealing all non-mine cells. Flags do not need to cover every mine — you just need every safe cell uncovered. You can play right now at Minesweeper on sourcecodestack, which runs entirely in your browser with no download needed.

How to Read the Numbers and Deduce Safe Cells

Numbers are the heart of Minesweeper. Every decision you make should trace back to what a revealed number tells you about its neighbours. Here is how to think about them systematically.

The basic constraint

A number N on a revealed cell means that exactly N of the hidden cells touching it (up to eight neighbours) contain mines. If a cell shows 1 and only one of its neighbours is still hidden, that hidden neighbour must be a mine — there is no other place for the mine to be. Conversely, if a cell shows 1 and you have already flagged one adjacent mine, all of its remaining hidden neighbours are safe to click.

The same reasoning scales upward. A cell showing 3 surrounded by exactly three hidden cells means all three are mines. A cell showing 3 surrounded by five hidden cells with two already flagged means exactly one of the remaining three hidden cells is a mine — you cannot yet say which one, but you can still use that constraint in combination with neighbouring numbers.

Combining two numbers

The most powerful deductions come from comparing two adjacent numbers that share some of the same hidden neighbours. If cell A shows 1 and cell B shows 2, and cell B has one extra hidden neighbour that A does not share, you can subtract A's constraint from B's constraint. A already accounts for one mine among the shared cells; B needs one more mine among the shared cells plus that extra one. Therefore the extra neighbour of B must be a mine.

This subtraction technique — sometimes called the constraint difference method — is the foundation of almost every advanced Minesweeper deduction. Practice spotting pairs of numbers that share a subset of hidden neighbours, subtract the smaller constraint from the larger, and see what the residual tells you.

Opening Strategy: Where to Click First

Your first click is completely safe on the sourcecodestack Minesweeper implementation. Mines are placed after you make your first move, so no cell you choose initially will ever explode. This means you can open the game strategically rather than randomly.

Start in the middle or near a corner

Clicking near the centre of the board maximises the chance of triggering a large flood-fill, which opens a wide region instantly and gives you many numbered cells to work with right away. The centre has the most neighbours, so a blank cell there connects to the largest possible open area.

Alternatively, clicking near a corner can also be productive. Corner cells have only three neighbours, so if the flood fill starts there it tends to uncover a compact safe zone quickly along the edge. Edges and corners are also where the 1-2-1 and similar boundary patterns appear most often, giving you early deductions.

The worst place to click first is in a dense region of the unexplored centre on a Hard board where a large cluster of mines might be concentrated — but since mine placement on the sourcecodestack version is random and avoids only your first-click cell, there is no way to know this in advance. Just click confidently and work with what the board gives you.

What to do after the flood-fill opens

After your opening click reveals a region, scan the boundary of revealed cells for the most constrained numbers first — cells with a small number and few remaining hidden neighbours. These give you the highest-quality deductions immediately. Work outward from what you know, resolving easy cells before moving into unknown territory.

Core Logic Patterns Explained Step by Step

Experienced players recognise several recurring configurations that allow immediate deductions without any guessing. Learning these patterns by sight drastically speeds up your game.

The 1-1 pattern

The simplest and most common pattern. Imagine two revealed cells side by side along an edge of the board, both showing 1. Each cell has a row of hidden cells above it. Because the board edge cuts off neighbours on one side, the first "1" has two hidden neighbours and the second "1" also has two hidden neighbours, with one cell shared between them.

Since both cells need exactly one mine among their hidden neighbours, and they share one of those neighbours, you can deduce the following: if the shared cell were the mine, both "1"s would already be satisfied. The unshared hidden cell of the first "1" and the unshared hidden cell of the second "1" are therefore safe — but only if the shared cell carries the mine. To confirm, you need to check whether any further number nearby can tell you whether the shared cell is a mine or not. In many board positions along an edge the 1-1 pattern resolves immediately: the two cells share a single overlap, and the non-overlapping cells are definitively safe.

In practice, you will see this written as: when two adjacent "1" cells each face the same direction along an edge, and one of them has an extra hidden cell the other does not, that extra cell is safe because the mine must be in the shared area.

The 1-2 pattern

Along an edge, a "1" next to a "2" is an extremely useful pairing. The "1" needs one mine from its (at most three) hidden neighbours. The "2" needs two mines from its hidden neighbours, some of which overlap with the "1".

Suppose the "1" has hidden cells A and B, and the "2" has hidden cells A, B, and C (all along an edge, so C is a unique neighbour of the "2" not shared with the "1"). The "1" accounts for exactly one mine in {A, B}. The "2" needs two mines in {A, B, C}. Since {A, B} contributes exactly one mine to the "2", cell C must be the second mine for the "2". You can flag C immediately.

Once C is flagged, the "2" is satisfied except for its one remaining mine in {A, B} — which is the same mine the "1" also needs. There are no additional deductions from this pair alone, but the flag on C is a guaranteed safe deduction.

The 1-2-1 pattern

This is one of the most satisfying patterns in Minesweeper because it resolves completely. Three numbers in a line along an edge read 1 — 2 — 1. Each number faces a row of hidden cells. Label the hidden cells as columns: the outer "1" on the left faces columns L1 and L2; the "2" in the middle faces L2, M, and R2; the outer "1" on the right faces R2 and R3. (This is approximate — the exact overlap depends on board position.)

Working through the constraints:

  1. Left "1" needs exactly one mine in {L1, L2}.
  2. Right "1" needs exactly one mine in {R2, R3}.
  3. Middle "2" needs exactly two mines in {L2, M, R2}.
  4. Substitute: the left "1" contributes one mine from {L1, L2}into the middle "2"'s set. The right "1" contributes one mine from{R2, R3} into the middle "2"'s set. Together that accounts for the two mines the middle "2" needs.
  5. Therefore cell M is safe — the middle "2" is already fully accounted for by the mines in L2 and R2.
  6. Furthermore, since L2 must carry the mine for the left "1", cell L1 is safe. Since R2 must carry the mine for the right "1", cell R3 is safe.

The 1-2-1 pattern typically lets you flag two cells and click three safe cells in one burst of reasoning. Spotting it quickly along a board edge is a hallmark of intermediate-to-advanced play.

The 1-2-2-1 pattern

A longer variant that appears along edges and sometimes diagonally. Four numbers in a row read 1 — 2 — 2 — 1. By chaining the same subtraction logic across all four cells, you can show that the outermost hidden cells (the ones exclusive to each outer "1") are safe, while the inner cells (exclusive to each "2") are mines.

Specifically: each outer "1" needs one mine from its two hidden neighbours (one shared with the adjacent "2", one not). Each inner "2" needs two mines. By subtraction, the unshared neighbour of each "2" (the one not touched by either "1") is a mine, and the unshared neighbours of each "1" are safe. The result is two flags and two safe reveals in a single pattern.

As with all patterns, the key is identifying which cells are shared between which numbers. Drawing a quick mental picture of the overlap is the skill that separates fast players from slow ones.

Flagging vs. Not Flagging: A Strategic Choice

Right-clicking an unrevealed cell plants a flag on it (or removes an existing flag). The flag does two things: it prevents you from accidentally clicking the cell, and it decrements the mine counter displayed at the top of the board so you always know how many unflagged mines remain.

For beginners, flagging every cell you identify as a mine is strongly recommended. It keeps track of your deductions visually and prevents costly accidental clicks, especially on Hard where 99 mines are scattered across a 16×30 grid.

As you gain experience, you may start skipping flags on mines you are confident you will avoid by sight. Flagging takes an extra click (right-click then left-click a neighbour), which adds up over hundreds of cells on Hard. Speedrunners often flag only the mines strictly needed to unlock a safe click — for example, when a "1" has one flagged mine already, you know all other neighbours are safe and can chord-click (click the number itself) to reveal them all at once without individually flagging each mine.

The bottom line: always flag when you are new to the game. Move to selective flagging only after you have internalised the patterns well enough to track mine positions in your head reliably.

When You Are Forced to Guess — and How to Pick the Best Cell

Even with perfect play, Minesweeper sometimes reaches a state where no deduction is possible without additional information. Two or more cells remain hidden, and all visible numbers are consistent with more than one mine arrangement among them. At this point you must guess.

This is a feature of the game, not a failure of strategy. On a standard Easy board you might never need to guess; on Hard boards, forced guesses are common. The key is to make informed guesses that minimise the probability of hitting a mine.

Calculate the local probability

When a number N has K hidden neighbours, the probability that any specific neighbour is a mine is roughly N/K if you have no other information. For example, a "1" with three hidden neighbours suggests each neighbour has a one-in-three chance of being a mine. A "1" with two hidden neighbours gives one-in-two odds for each. Choose the cell with the lowest estimated mine probability.

Prefer cells in open areas

Completely isolated hidden cells — those not adjacent to any revealed number — carry only the global mine density as their probability. On Easy (10 mines / 81 cells) that is about 12%. On Hard (99 mines / 480 cells) it is about 21%. If a forced guess involves a cell that could trigger a flood-fill into uncharted territory versus a constrained corner cell with a 33% mine probability, the isolated cell may be the better bet even though it feels riskier.

The 50/50 guess

The most dreaded situation: two hidden cells and a "1" that constrains exactly one of them as a mine, with no surrounding context to break the symmetry. This is a pure coin flip. Accept it, pick one, and move on. Even the best players lose roughly half of these situations. If you lose, it was not bad play — it was an unavoidable random outcome. Start a new game and apply the same careful logic again.

Tips to Get Faster at Minesweeper

Speed in Minesweeper comes from reducing the time between decisions, not from rushing decisions themselves. Here are the most effective ways to improve your times:

  1. Recognise patterns instantly. Drill the 1-1, 1-2, and 1-2-1 patterns until you can identify them at a glance without working through the logic consciously. Print a diagram or replay easy boards just to practice spotting them.
  2. Use the chord click. When a revealed number already has the correct number of flags placed around it, clicking the number itself (chord-clicking) instantly reveals all remaining hidden neighbours. This is far faster than clicking each safe cell individually.
  3. Minimise mouse travel. Start your opening click near the centre so that the subsequent solving area is as central as possible. Moving the mouse across a 16×30 Hard board takes real time.
  4. Flag selectively. Only flag mines that you need to flag in order to unlock safe clicks. Every unnecessary flag is two extra clicks (right-click to place, right-click again to remove if you misidentify). On Easy, experienced players rarely flag at all.
  5. Solve in waves. Rather than fixing your eyes on one cell, scan the entire boundary of revealed cells and identify all immediately solvable cells before clicking any of them. Then execute the clicks quickly. This batched approach is faster than alternating between thinking and clicking one cell at a time.
  6. Move up difficulty gradually. Trying to go straight to Hard without mastering Easy and Medium leads to discouraging losses that teach little. Consistent 50-second Easy clears and sub-3-minute Medium clears are better prerequisites for Hard than pure repetition.
  7. Stay calm on forced guesses. Hesitating too long on a true 50/50 wastes seconds without improving your odds. Once you confirm there is no logical resolution, pick the most favourable cell by probability and click immediately.

Difficulty Levels: Grid Sizes and Mine Counts

The sourcecodestack Minesweeper offers three difficulties that match the classic Windows Minesweeper settings players have used for decades:

DifficultyGrid SizeMinesTotal CellsMine DensityBest For
Easy9 × 91081~12%Learning patterns and first wins
Medium16 × 1640256~16%Practising patterns on a larger board
Hard16 × 3099480~21%Advanced play and competitive timing

Easy (9×9, 10 mines)

Easy is the ideal starting point. The 9×9 grid is small enough that a well-placed opening click often uncovers more than half the board in a single flood-fill. With only 10 mines at roughly 12% density, you will rarely face more than one or two forced guesses per game. Focus on Easy until you can reliably win in under 60 seconds with consistent logic — then move on.

Medium (16×16, 40 mines)

Medium introduces the larger 16×16 grid and bumps density to about 16%. The board is large enough that the flood-fill rarely clears more than a third of it, meaning you will solve more cells manually. Patterns like 1-2-1 appear frequently along the board edges. Forced guesses are more common than on Easy, and one wrong guess in a constrained area can cascade badly. Medium is where most players spend the most time developing their core pattern recognition skills.

Hard (16×30, 99 mines)

Hard is the benchmark difficulty for serious Minesweeper players. The 16×30 grid packs 99 mines at roughly 21% density, which is high enough that clusters of mines often produce complex 3-4-5 numbered cells deep inside the board. The sheer number of cells means a single game requires sustained concentration over many minutes. Expect multiple forced guesses per game, and expect to lose even with perfect logic simply because of unfavourable 50/50 outcomes. The world-record time for Hard is under 40 seconds — achievable only with pattern recognition so automatic it requires no conscious deliberation.

Putting It All Together: A Session in Practice

Here is how a typical successful Minesweeper session on Medium looks when you apply everything above:

  1. Click near the centre. Hope for a large flood-fill that exposes a wide open region with plenty of boundary numbers to work from.
  2. Scan the entire boundary of revealed cells. Identify every number that already has its full mine count satisfied by flags, and every number whose hidden neighbours must all be mines. Resolve all of these before clicking.
  3. Apply 1-1 and 1-2-1 patterns along edges. Flag the cells that must be mines; click the cells that must be safe.
  4. Use the constraint-difference technique on any adjacent number pairs that share hidden neighbours. Subtract the smaller constraint from the larger and see if the residual cell can be determined.
  5. Continue expanding outward in waves, always working from the most constrained areas inward.
  6. When stuck with no deductions available, identify the cell with the lowest estimated mine probability and click it. If you survive, the new information may unlock a fresh chain of deductions.
  7. Repeat until either you clear the board and win, or you hit a mine and start a new game.

Ready to practise? Open the free Minesweeper game and start with Easy. Run through a few boards focusing exclusively on identifying the 1-1 pattern. Once that becomes automatic, add the 1-2 and 1-2-1 patterns. Within a few sessions you will find that Medium boards that once felt impenetrable become straightforward exercises in systematic logic.

Minesweeper rewards patience, attention, and the willingness to accept that some losses are inevitable. The logic is entirely learnable — and the satisfaction of clearing a Hard board without guessing wrong is one of the most gratifying experiences in classic puzzle gaming.