The best dots and boxes strategy comes down to three habits: never draw the third side of a box while you have a safe line left, count the long chains so your opponent is the one who has to open them, and when they open one, take all but the last two boxes and hand those back. That last trick, called double-dealing, forces your opponent to open the next chain too, and it's how strong players win games they look to be losing.
None of this is guesswork. We played thousands of games between the computer levels in Poozee's Dots and Boxes and checked every example below with an exact solver. Here's what we did and what we found.
How we tested
Poozee's game has three computer levels, and each one plays the way a certain kind of player does:
- Easy takes every box it can, but 40% of the time it draws a line without looking, often giving boxes away.
- Medium takes every box, never draws the third side of a box while it has another choice, and when it has to give boxes away it gives the fewest. It never double-deals.
- Hard plays like Medium early on. Once 18 or fewer safe lines are left, it looks at every order in which they could be drawn (assuming neither side gives boxes away while it still has a safe line) and works out the endgame that follows exactly, and once no safe lines are left (or 20 or fewer lines of any kind) it plays perfectly.
Each pair of levels played 100 games on each board size, taking turns to go first. Every game used a fixed random seed, so the results can be reproduced exactly.
| Board | Hard vs Medium | Medium vs Easy |
|---|---|---|
| 3x3 (9 boxes) | 99 wins, 1 loss | 65 wins, 35 losses |
| 4x4 (16 boxes) | 95 wins, 1 loss, 4 draws | 75 wins, 21 losses, 4 draws |
| 5x5 (25 boxes) | 100 wins, 0 losses | 87 wins, 13 losses |
The gap between Easy and Medium is the first habit below. The gap between Medium and Hard is everything else, and it grows with the board.
1. Don't draw the third side
A box with three sides drawn is a gift: whoever moves next closes it and goes again. So early in the game, only draw safe lines, ones that don't give any box its third side.
It costs more than one box. Poozee's solver, which checks every possible way the rest of this game could go, rates the highlighted line four boxes worse than the best line on the board.
Easy's careless lines are exactly this mistake, and they're why Medium beat it 65 to 87% of the time, more on bigger boards where one early gift snowballs.
2. The endgame is chains and loops
Sooner or later the safe lines run out. Then every line gives something away, and the open boxes form chains (boxes joined in a row, where taking one opens the next) and loops (chains that close back on themselves).
- A long chain has 3 or more boxes. A short chain has 1 or 2.
- A loop has at least 4 boxes.
Whoever has to move here must open the loop or the chain. The player who doesn't have to open the long chains is said to have control, and control usually decides the game.
3. Double-dealing: give two to keep control
Here's a 3x3 game where you drew first. Every safe line is gone: there's a chain of four (green) and a chain of five (blue), and it's your opponent's move. They open the chain of four by drawing the highlighted line.
The greedy move is to take all four boxes. But then you have to draw another line, and the only lines left open the chain of five. Your opponent takes all five and wins 5 to 4.
Instead, take two boxes and then draw the line at the far end of the chain, leaving the last two boxes as a pair:
Your opponent takes the pair with a single line (a double-cross: one line, two boxes), and now they have to move, which means opening the chain of five for you. You finish 7 to 2. Two boxes handed over bought five back, turning a one-box loss into a five-box win. The solver confirms that double-dealing is the best play here, and taking all four is a loss.
Pro tip: When your opponent opens a long chain, count before you grab. If more long chains or loops are waiting, take all but two and hand the pair back. Only take everything when it's the last chain, or when giving two away would cost more than control is worth.
Loops cost four
A loop works the same way, but keeping control costs four boxes instead of two. Here it's the other way around: you drew second, the board is the one from section 2, and your opponent has just opened the loop.
Take the four and you must open the chain of five: you lose 4 to 5. Draw the highlighted line instead, taking nothing, and your opponent gets two pairs (two double-crosses) but then has to open the chain of five. You win 5 to 4. Declining a whole loop feels wrong, and it's still the winning move.
How much double-dealing is worth
To measure it, we played Hard against a copy of itself that always takes every box it can and never double-deals. Everything else about the two was the same.
| Board | Hard vs Hard that never double-deals |
|---|---|
| 3x3 | 54 wins, 46 losses |
| 4x4 | 50 wins, 20 losses, 30 draws |
| 5x5 | 80 wins, 20 losses |
On 3x3 it barely matters: that board is small enough that both copies play almost perfectly from the fifth line on, and with perfect play the second player wins there. Whoever moved second won 94 of the 100 games. On bigger boards, with more chains to fight over, double-dealing wins far more games than it loses.
4. The long chain rule
Control goes to whoever doesn't have to open the first long chain, so the real fight happens earlier, while safe lines are still left. The long chain rule tells you which number of long chains you want.
It comes from counting turns. Every turn ends with a line that closes nothing, except the very last turn of the game. Work through that, and the number of turns in any game always equals the number of dots plus the number of double-crosses. We checked this in all 1,500 games from the tables above and it held every time.
The player in control takes the last chain, so they play the last turn. And in a normal endgame the player in control double-deals every long chain except the last, so there's one double-cross fewer than there are long chains. Put together:
- Count the dots and add the number of long chains you expect.
- If the total is even, the first player gets control. If it's odd, the second player does.
- Loops don't change the count: each one adds two double-crosses, which keeps even even and odd odd.
| Board | Dots | First player wants | Second player wants |
|---|---|---|---|
| 3x3 boxes | 16 | an even number of long chains | an odd number |
| 4x4 boxes | 25 | an odd number of long chains | an even number |
| 5x5 boxes | 36 | an even number of long chains | an odd number |
Both examples above follow it. In the double-dealing game there were 16 dots and 2 long chains, 18 in all, so you, the first player, had control. In the loop game there were 16 dots and 1 long chain (loops don't count), 17 in all, so the second player had it.
You steer the count while safe lines are left, by joining two would-be chains into one or cutting one into two. Hard does this by searching; you can do it by counting. And the count really does decide games. When two Hard computers played each other, the player who first had to give away three or more boxes in one line (opening a long chain or a loop) lost:
| Board | Hard vs Hard | Medium vs Medium |
|---|---|---|
| 3x3 | 97 of 99 games | 60 of 100 games |
| 4x4 | 72 of 74 games (26 were draws) | 48 of 97 games (3 were draws) |
| 5x5 | 94 of 100 games | 58 of 100 games |
Games where nobody ever opened a long chain aren't counted. The Medium column is the lesson: control only wins if you know how to keep it. Medium never double-deals, so it hands control straight back after its first chain.
5. Short chains change who opens
Short chains are the tool of the player who's losing the chain fight: giving away one or two boxes passes the move to the other player. That makes the order of the giveaways matter.
Here there are 16 dots and 2 long chains, an even total, so the first player has control, and the second player, who has to move, loses whatever they do. But how much they lose depends on what they give away first. The solver says opening the single box or one of the chains of three loses by one box (4 to 5), while opening the pair loses by three (3 to 6). When you're the one who has to open, count what happens after each option instead of just giving away the smallest thing.
Beating the computer
Easy falls to the first habit alone: draw safe lines, take its gifts, and count before giving anything away. Medium never makes that mistake, but it always grabs every box, so win the chain fight and double-deal against it. Hard plays the endgame perfectly, so the only way to beat it is to win the long chain count before it starts searching, while there are still plenty of safe lines. Use Hint to see the line Hard would draw in your place.
For the theory behind all of this, the standard book is Elwyn Berlekamp's The Dots and Boxes Game: Sophisticated Child's Play (A K Peters, 2000).
Keep playing
Try these ideas against the computer in Dots and Boxes: start on 3x3 to practice double-dealing, then move up to 5x5 where the long chain rule matters most. If you like games where counting ahead wins, read how to win at Connect Four and how to win at checkers, then play Four in a Row or Checkers.
Frequently asked questions
Is there a winning strategy for dots and boxes?
No trick wins every game, but the key idea is control: make your opponent open the long chains, and when they do, take all but two boxes so they have to open the next one too. When two copies of our Hard computer played each other, whoever first had to open a long chain went on to lose at least 94% of the time.
Who wins dots and boxes on a 3x3 board with perfect play?
The second player. Poozee's solver checked every line of play on the 3x3 board (16 dots): whatever the first player does, the second player can win 6 boxes to 3.
What is a double-cross in dots and boxes?
A single line that closes two boxes at once. It happens when a player hands over the last two boxes of a chain as a pair: the opponent takes both with one line and then has to draw another line.
Does going first matter in dots and boxes?
It matters through the long chain rule. On 3x3 and 5x5 boards the first player wants an even number of long chains, and on 4x4 an odd number. On 3x3, perfect play wins for the second player.