Counting lesson

The Dots and Boxes chain rule, counted out loud

Hold up your fingers. We're going to count one board together, and by the end you'll know who wins it before a single box is taken.

The Dots and Boxes chain rule, also called the long chain rule, predicts who will win the endgame. Add the dots on the board to the number of long chains. If the total is even, the first player is on track; if it's odd, the second player is.

Last updated

  1. 1

    Count the dots

    On a square board use (n+1)²: 16 dots on 3×3, 25 on 4×4, 36 on 5×5.

  2. 2

    Count the long chains

    Only chains of three or more boxes with open ends. Leave loops and short chains out.

  3. 3

    Add them up, check odd or even

    Even favors the first player, odd favors the second. Wrong one for you? Change it while safe lines remain.

What a chain is in Dots and Boxes

Before we count anything, let's agree on what we're counting. A chain is a row of boxes that each already have two sides drawn, linked to each other through their open sides. Draw any line inside it and one box gets its third side. Your opponent closes that box, which earns another line, which closes the next box, and down the row it goes.

Three boxes, two sides each, both ends open. That's a chain.

A chain of one or two boxes is a short chain. Three or more makes a long chain, and long chains are the only ones the rule cares about. A loop is a chain that bends around and meets itself, so it has no open end; the smallest possible loop is four boxes in a square. Loops stay out of the count, too.

Short chain: two boxes. Not counted.
Loop: four boxes, no open end. Not counted.

Counting long chains on a real board

Here's our board: 3×3 boxes, so four dots along each side. Every horizontal line has been drawn and none of the vertical ones. Have a look before reading on, and see if you can guess who's winning.

Three rows of three boxes, every end open. You move first; the computer moves second.
Play this position →

First finger: dots. Four rows of four is sixteen. Now the long chains. The top row is three boxes with both ends open, so that's one. The middle row, two. The bottom row, three. Sixteen plus three makes nineteen.

First player: wants dots + long chains to be even. Second player: wants it odd.

Nineteen is odd, and odd belongs to the second player. Every line left on this board opens a chain, and it's the first player's turn, so they have to start handing them out. With perfect play from here, the second player finishes ahead 5 boxes to 4. Press the button under the board and try to prove me wrong.

How one line changes the long chain count

Let's rewind and change one decision. Suppose nobody ever drew the line under the box in the top-right corner, and the right-hand edges of the top two rows were drawn instead.

The top two rows now join at the right into one chain of six.

Count again. Still sixteen dots. But the top and middle rows now link up around the right-hand side into one long chain of six, and the bottom row is still a chain of three. Two long chains. Sixteen plus two is eighteen, which is even, so now the first player is the one in control. With best play they collect 7 of the 9 boxes.

Same board, same nine boxes, and a narrow loss became a big win. That's why strong players fight over the chain count while the board is still half empty and safe lines are around to play with.

Board (boxes)DotsFirst player wantsSecond player wants
3×316an even number of long chainsan odd number
4×425an odd number of long chainsan even number
5×536an even number of long chainsan odd number
6×649an odd number of long chainsan even number

Ways to change the count while you still can

  1. Join two areas into one chain by leaving the wall between them open. Two long chains become one.
  2. Split a long area with a line across it, so it ends up as two chains, or one long and one short.
  3. Trim a chain down to two boxes, which drops it out of the count completely.
  4. Bend a chain round until its ends meet and it becomes a loop. Loops don't count either.

All of this has to happen before the safe lines run out. Once no safe line is left anywhere, the count is locked in, and the result usually follows it.

Why the chain count matters: control

The rule works because of what happens when somebody opens a long chain. The player receiving it takes all but two boxes, then hands that pair back with a double cross, leaving the other player to open the next chain. Being the one who receives every chain is called having control.

Control costs two boxes per long chain, or four per loop, which is why margins on small boards are so tight. On a big board full of long chains, it's worth a great deal more.

If the count is against you and the chains are already set, limit the damage. Open the smallest chains first. Offer loops early, since keeping control of one costs your opponent four boxes. And when you have to give away a pair, draw the line between the two boxes, not at the end, so the pair can't be handed back to you.

Every idea on this page can be tested against the computer, which thinks inside your own browser. Nothing about your games leaves your device.

At the board

Counting questions that come up mid-game

  • Two chains touch at a corner

    Corners don't join chains. Boxes only link through a shared open side.

  • A chain of exactly two

    That's a short chain. Leave it out of the count.

  • A ring of four boxes in the middle

    A loop. It doesn't count, but it costs four boxes to keep control of.

  • The count suits you and one safe line is left

    Play it somewhere that leaves the chains exactly as they are.

  • You can't tell where a chain ends

    Trace it box by box through the missing sides until you reach a dead end.

  • You're first player on 5×5

    36 dots, so you're hoping the long chains come out even.

Good to know

Chain rule questions

What is the long chain rule?

It's a counting shortcut for the endgame. Add the number of dots to the number of long chains: the first player wants an even total, the second player an odd one. Whoever the total favors is usually left in control when the chains are handed out.

What counts as a long chain?

Any run of three or more connected boxes with open ends. Each box in it already has two sides, so a single line inside sets off the whole row. Runs of just one or two are short and stay out of the count.

Do loops count as long chains?

Loops are left out of the long chain rule. A loop closes on itself, so there's no open end to start from. They still matter for the score, because keeping control through a loop means giving away four boxes instead of two.

How do you count chains to know who wins?

Wait until the safe lines are nearly gone, then trace each group of two-sided boxes and note how long it is. Count only the groups of three or more with open ends. Add that number to the dots and check whether the total is odd or even.

How do you change the number of chains?

While safe lines remain, you can join two areas into one chain, split a long area in two, trim a chain to two boxes, or close one into a loop. Each of these moves the count by one. The board on this page shows joining two rows turning a 4 to 5 loss into a 7 to 2 win.

Does the chain rule work on every board size?

It works on any rectangular board, but the target shifts with the dot count. On boards with an even number of dots, like 3×3 and 5×5, the first player wants an even number of long chains; on 4×4 and 6×6, with an odd dot count, it flips. Small boards have tight margins, so a single box can decide them.