Back to BlogGame Guides

How to Play Dots and Boxes: Rules, Chains and Strategy That Wins

How to play Dots and Boxes: the rules, why you never draw the third side of a box, chains and the all-but-two trick, plus who wins every small board with perfect play, worked out by our own solver. Free game included.

How to Play Dots and Boxes: Rules, Chains and Strategy That Wins

Dots and Boxes is a game for two players on a grid of dots. You take turns drawing a line between two dots that sit next to each other. Whoever draws the fourth side of a box takes that box and draws again. When every line is drawn, the player with more boxes wins.

You can play it with a pencil and paper, and we also have our own free version in Game Attic, our collection of free browser games. It is played on a 6 by 6 grid of dots, 25 boxes, against a computer player on three levels, or against a friend on one screen. You can play Dots and Boxes free while you read. After the rules, we look at strategy with numbers we worked out ourselves: an exact solver for the small boards people draw on paper, and 6,000 games between Game Attic's computer players on the big board.

How to play Dots and Boxes: the rules

  1. Draw the grid. Any size works. A 4 by 4 grid of dots (9 boxes) is a quick game; Game Attic uses 6 by 6 dots (25 boxes and 60 lines).
  2. Take turns. On your turn, draw one line, across or down, between two dots that are next to each other. No diagonals.
  3. Close a box. If your line is the fourth side of a box, the box is yours. Write your initial in it, or in Game Attic it fills with your color.
  4. Go again. Closing a box gives you another line straight away. If that line closes another box, you go again, and so on. One line can close two boxes at once.
  5. No passing. If you did not close a box, the turn goes to the other player. You always have to draw a line.
  6. The end. When every line is drawn, every box has an owner. The player with more boxes wins.

Two small boards: before, the top left box has three sides drawn; after, coral draws the gold fourth side, the box turns coral and coral draws again

The first rule of strategy: never draw the third side

If you draw the third side of a box, the other player draws the fourth and takes it, and then draws again. So the first thing to learn is simple: avoid drawing the third side of any box while you have another choice.

At the start of a game there are plenty of safe lines. Two careful players draw them one by one, and nobody takes a box for a long time. We measured this with Game Attic's own computer players. Medium and Hard both avoid the third side. Easy does not: it takes a box when it can, and otherwise draws any line.

Bar chart: when the safe lines run out, Easy against Easy has about 6 of the 25 boxes still open after about 52 of 60 lines; Medium against Medium and Hard against Hard have all 25 boxes open after about 30 of 60 lines

Between two Medium players, or two Hard players, the safe lines ran out after about 30 of the 60 lines, and at that moment all 25 boxes were still open, in every one of 2,000 games. Nobody took a single box in the first half of the game. Every box was decided in the second half, by who had to give the first ones away. Between two Easy players, most boxes were already gone by then: only about 6 were left.

So the real game of Dots and Boxes starts when the safe lines are gone. That is where chains come in.

Chains and the all-but-two trick

When the safe lines are gone, the board has broken up into chains: rows of boxes joined side by side, where drawing any line inside one gives the other player the whole row. The player who has to move must open a chain and give it away. The other player takes it, and then, because they must still draw a line after the last box, they have to open the next chain.

That last part is the key, and good players get round it with a trick called all but two (it is also called a double cross). When your opponent opens a chain for you, take every box but the last two. Then, instead of taking those two, draw the line at the far end of the chain. Your opponent takes the two boxes with one line, and now it is their turn to open the next chain.

Three rows of a 4 box chain: Blue opens the left end; simple play, Coral takes all 4 boxes; all but two, Coral takes 2 and draws the far end, leaving 2 boxes for Blue, who then has to open the next chain

You give up two boxes, but you keep control: from then on your opponent opens every chain and you take most of each one. On a board with several long chains, that is worth far more than two boxes. It only makes sense with a chain of 3 or more. Give away a 1 or 2 box chain and you get nothing back.

The game's Hard level does exactly this. When few enough lines are left, it works out the rest of the game move by move, so it knows when to take everything and when to leave the last two.

Who wins on a small board?

Dots and Boxes on a small board can be solved: a computer can look at every possible game and work out the result when both players make the best move every time. We wrote our own solver and ran it on seven small boards, up to 4 by 4 dots. The 4 by 4 board has 24 lines, so the solver had to score all 16,777,216 ways the lines can be drawn.

Table of small boards with perfect play: 2 by 2 dots, second player wins 1 to 0; 2 by 3, tie 1 to 1; 2 by 4, second player wins 2 to 1; 3 by 3, first player wins 3 to 1; 3 by 4, second player wins 4 to 2; 3 by 5, first player wins 5 to 3; 4 by 4, second player wins 6 to 3

The 4 by 4 grid, 9 boxes, is the board most people draw on paper, and with perfect play the second player wins it 6 boxes to 3. Every one of the first player's 24 possible first lines loses by 3. On the 3 by 3 grid, 4 boxes, the first player wins 3 to 1, and 8 of the 12 first lines keep that win.

Nobody plays perfectly, so this does not mean the first player always loses at 4 by 4. But it does show that who wins comes down to the end of the game, not the start. The 4 by 4 game is decided by how the chains fall, and by who is forced to open them.

How long chains decide the winner

A simple way to think about it near the end: count the long chains, the ones with 3 or more boxes. The player in control is the one whose opponent will have to open the first long chain. Each turn you have, you decide whether to give away a short chain to change who that will be.

You do not need to count exactly to get better. These habits help:

  1. Never draw the third side while a safe line is left.
  2. Watch the safe lines. When only a few are left, think about who will draw the last one.
  3. Give away short chains first. If you must give something, give a single box or a pair, not a long row.
  4. Take all but two of a long chain when there is another long chain still to come.
  5. Take everything from the last chain on the board. There is nothing left to keep control of.

How good are the computer players?

We played 1,000 games for each pairing on Game Attic's 6 by 6 dot board, with each side moving first in half the games.

Bar chart: Medium beats Easy in 95.8% of games, Hard beats Easy in 99.7%, Hard beats Medium in 97.2%, with the average winning margins in boxes

Medium beat Easy in 95.8% of games, by about 13 boxes on average, just by not giving boxes away. Hard beat Medium in 97.2%, by about 12.5 boxes. Medium never draws a third side while a safe line is left, so it plays the first half as well as Hard does. The whole difference is the end of the game, where Hard counts out the chains and Medium just gives away the smallest one it can. Between two players of the same level, the one who drew the first line had no real edge: 44.8% for two Easy players, 48.0% for Medium and 51.6% for Hard.

Dots and Boxes on paper

Dots and Boxes was described in print by the French mathematician Édouard Lucas in 1889, and it has been played in school notebooks ever since. You need only a pencil and a grid of dots. Two easy ways to change it:

  • Board size. 3 by 3 dots is a two minute game. 6 by 6 dots or bigger gives long chains and more room for strategy.
  • Who goes first. Take turns starting, since on some boards the first or second player has the edge with perfect play.

Play Dots and Boxes free

This is Dots and Boxes from Game Attic, the same game as on the full site. Tap the space between two dots to draw a line there. You are coral and the computer is blue. When you close a box, it fills with your color and you tap again. Pick Easy, Medium or Hard at the top, or press New game to start over.

Loading the game…

For the full screen version, with your record and a two player mode for a friend on the same screen, play Dots and Boxes in Game Attic. It is free, with no download and no sign-up. If you like games where you think a few moves ahead, try Mancala or Four in a Row.

Questions people ask

How do you play Dots and Boxes step by step?

Draw a grid of dots. Take turns drawing a line between two dots next to each other. If your line closes a box, you take the box and draw again. When all the lines are drawn, the player with more boxes wins.

What is the best strategy for Dots and Boxes?

Never draw the third side of a box while you have a safe line. Near the end, give away short chains first, and when your opponent opens a long chain, take all but the last two boxes so they have to open the next one.

Does the first player have an advantage in Dots and Boxes?

It depends on the board. With perfect play, our solver found that the first player wins on 3 by 3 dots, and the second player wins on 4 by 4 dots, 6 boxes to 3. In real games between Game Attic's computer players on 6 by 6 dots, the first player won about half the time.

What is a double cross in Dots and Boxes?

It is when one line closes two boxes at once. It usually happens after the all-but-two trick: one player leaves the last two boxes of a chain, and the other takes both with one line, then has to open the next chain.

Can you play Dots and Boxes online for free?

Yes. Dots and Boxes in Game Attic is free in your browser, against the computer on three levels or against a friend on the same screen.

How we worked it out

The rules come from Game Attic's own Dots and Boxes. The small board results come from our own exact solver, which starts from every possible full board and works backwards, scoring every way the lines can be drawn, up to all 16,777,216 for 4 by 4 dots. The big board numbers come from a program that runs Game Attic's own code with its own computer players: 1,000 games for each of six pairings on the 6 by 6 dot board, 6,000 games in all. "Safe lines run out" means the first moment the player to move cannot take a box and every line left would give a box away.

Game Attic and its Dots and Boxes are made by Logic Loft Games and are not connected with any other Dots and Boxes game or app.

By Tim Nye, Logic Loft Games

Share this post