Clever Quest Lab ← Games

Dots and Boxes

Close boxes to claim them, and learn why giving away two boxes on purpose usually wins.

You 0
Computer 0
–Boxes left

Dots and Boxes

Take turns joining two neighbouring dots. Draw the fourth side of a box to win it and draw again. Most boxes wins.

Click or tap a line to draw it. Keyboard: arrow keys walk from dot to dot, Space draws the highlighted line.

Click a line between two dots to draw it. Keyboard: arrow keys walk from dot to dot, Space draws the highlighted line.

Tap the gap between two dots to draw that line; slide before lifting to pick another.

Opponent
Boxes
First move

Click or tap a line to draw it · keys: arrows walk from dot to dot, Space or Enter draws, U undo, N new game, F full screen

Click a line to draw it · keys: arrows walk from dot to dot, Space or Enter draws, U or Ctrl+Z undo, N new game, F full screen

Tap between two dots to draw a line. Undo takes back your last line.

Arrow keys walk a cursor from dot to dot and highlight the line just passed. Space or Enter draws it. U undoes.

Runs on your device. Nothing you type or record is uploaded. Keeps working without a connection while the page is open. Works with touch. Saves the game in progress, your settings and your record for each level and board size on this device.

Added · Updated : repeatable Hard versus Medium measurement and sources

How to play

Dots and Boxes is a pencil-and-paper game for two players on a square grid of dots. Players take turns drawing one horizontal or vertical line between two neighbouring dots. Whoever draws the fourth side of a box claims it: the box fills with that player’s colour, pattern and initial (stripes for you or Player 1, dots for the computer or Player 2), and that player must draw another line straight away. A single line can close two boxes at once. When every line is drawn, the player with more boxes wins.

Boards run from 3×3 to 7×7 boxes. A board of n×n boxes has (n+1)² dots and 2n(n+1) lines, so 5×5 has 36 dots and 60 lines. Play the computer on three levels or a friend on the same device, and choose who moves first or let it alternate. Boards with an even number of boxes (4×4, 6×6) can end in a draw.

Controls

The last line played glows amber.

How it works

Good play is about chains: rows of boxes that already have two sides each. The first line drawn into a chain lets the opponent take every box in it. Early on both players draw safe lines that give nothing away; sooner or later none is left and someone has to open a chain.

Whoever is handed a long chain (three or more boxes) need not take all of it: they can take all but two boxes and draw the line at the far end, leaving a two-box domino that the other player closes with one line. This trick, double-dealing, costs two boxes, but the other player must then open the next chain. A loop is declined by leaving four boxes. Keeping control like this usually wins the endgame.

Every turn ends with a line that closes no box, except the last turn of the game, and a line that closes two boxes at once is called a double-cross. A board of m×n boxes has 2mn + m + n lines, of which (boxes − double-crosses) close a box, so:

turns = lines − (mn − double-crosses) + 1 = (m+1)(n+1) + double-crosses = dots + double-crosses

If the player in control declines every long chain except the last, there is one double-cross fewer than there are long chains, and that player also plays the last turn. The first player plays the odd-numbered turns, which gives the long chain rule: the first player wants the number of dots plus the number of long chains to be even, the second player wants it odd. Loops do not change the count, because declining a loop produces two double-crosses.

Easy draws random lines that give nothing away and takes a box you offer only about three times in five. Medium takes every box it can and avoids drawing a third side; when it must give something away it gives the fewest boxes, but it never double-deals. Hard double-deals when keeping control pays. When only a few safe lines are left, it searches the orders in which they can be played and values each endgame with the chain-and-loop analysis, so that you have to open the first chain, and it may give away a box or two to win back control. In 1,200 test games against Medium, 240 on each board size, run on 22 October 2026, Hard won 1,194, drew 2 and lost 4.

Tips and strategy

Frequently asked questions

Who invented Dots and Boxes?

The French mathematician Édouard Lucas described it in 1889 under the name la pipopipette. The American mathematician Elwyn Berlekamp later wrote a whole book about its strategy.

Why did the computer leave me two boxes?

That was double-dealing: you get two boxes but must then draw another line, which opens the next chain for the computer.

Can I beat Hard?

Yes. Hard plays random safe lines until only a few are left, and on big boards its search has a size limit, so a player who counts chains early can steer the game.

Sources