Skip to content
Dots and Boxes

Dots and Boxes

Advertisement

Dots and Boxes on 3×3, 4×4 or 5×5 boxes against the computer at three levels or with a friend on one device. Close boxes to score.

What is Dots and Boxes?

Dots and Boxes is a two-player pencil-and-paper game played on a grid of dots, in which players take turns drawing a line between two neighbouring dots, and whoever draws the fourth side of a square box claims it and draws again. When every line has been drawn, the player with more boxes wins.

It looks like a game for passing time in class, and it is often played that way. Underneath, it has a deep strategy that mathematicians have studied for decades. The key idea is control: at the end of a game, the player who forces the other to open the long chains of boxes usually takes most of them.

How to play Dots and Boxes

Our game offers boards of 3×3, 4×4 or 5×5 boxes, which means grids of 16, 25 or 36 dots. Players take turns drawing one horizontal or vertical line between two dots that sit next to each other. Diagonal lines are not allowed, and a line can only be drawn once.

If your line completes the fourth side of one box, or of two boxes at once, those boxes become yours and you must draw another line. Your turn continues for as long as each new line completes a box and ends with the first line that does not.

The game ends when all lines are drawn and every box has an owner. The player with more boxes wins. The 3×3 and 5×5 boards have an odd number of boxes, 9 and 25, so they always produce a winner; only the 4×4 board, with 16 boxes, can end in a draw.

Dots and Boxes strategy: chains, sacrifices and control

Do not draw the third side. A box with three sides drawn is a gift: your opponent takes it and moves again. Early in the game, every move that does not create a third side is a safe move. The first phase of the game is a contest over who runs out of safe moves first.

Know chains and loops. As safe moves run out, the board breaks into chains, rows of boxes where taking one box opens the next, and loops, chains that close on themselves. A chain of three or more boxes is a long chain. Opening a chain gives all of its boxes to the opponent, so when you are forced to give something away, open the shortest chain first.

Use the double-dealing move. When your opponent opens a long chain, you do not have to take all of it. Take every box except the last two, then draw the line at the far end so those two remain as a pair your opponent can take with a single line. They take the two boxes and then have to open the next chain for you. For a loop, leave four boxes in the same way. This sacrifice is how a player keeps control.

Count when control pays. Keeping control costs two boxes per chain and four per loop, so it pays when the remaining chains are long. With many short chains, taking everything can be better.

Fight for the right number of chains. A rule from the book by mathematician Elwyn Berlekamp, known as the long chain rule, says the first player should aim to make the number of dots plus the number of long chains an even number, and the second player wants it odd. Loops do not count as long chains. On our 3×3 and 5×5 boards (16 and 36 dots) the first player wants an even number of long chains; on 4×4 (25 dots) an odd number. Steering the middle game toward the right count is what decides who gets control at the end.

Board sizes and computer levels

The 3×3 board is quick and good for learning how chains form. The 4×4 and 5×5 boards give longer games with more chains and more room for the strategy above. You play against the computer at Easy, Medium or Hard, choosing who moves first, or with a friend on one device.

Easy often takes free boxes but otherwise plays loosely. Medium always takes boxes, avoids giving any away while it can, and then opens the cheapest chain. Hard also uses the double-dealing move at the end of a chain and looks ahead through the last safe moves to avoid opening the first long chain. To beat Hard you need to win the fight over the chain count.

The history of Dots and Boxes

Dots and Boxes was first described in 1889 by the French mathematician Édouard Lucas, who called it la pipopipette. It spread as a school game in many countries, and it is still one of the best known games that need only paper and a pencil.

Its strategy has been studied in depth by mathematicians working on combinatorial game theory. Elwyn Berlekamp, one of the founders of the field, wrote a whole book about it, The Dots and Boxes Game, published in 2000, where the long chain rule and the double-dealing move are explained in detail.

Play Dots and Boxes free on Hevagames

Dots and Boxes runs in the browser on phones, tablets and computers, with no download. Each line has an enlarged invisible touch area, so lines are easy to hit on a small phone screen. You can also use the arrow keys to move between lines and Enter or Space to draw. A box counter for each player sits above the board.

Undo, with the button or Ctrl+Z, takes back your last move and the computer's reply. A game left unfinished stays in your browser, wins in a row against the computer are counted as a streak, and the game follows the site's light or dark theme.

How to play

  1. 1Choose vs Computer (Easy, Medium or Hard, and who moves first) or 2 Players, then a board size.
  2. 2Take turns drawing one line between two neighbouring dots.
  3. 3Draw the fourth side of a box and it becomes yours, and you draw again.
  4. 4When every line is drawn, the player with more boxes wins. Equal counts are a draw.

Controls

Draw a line
TapClick
Move between lines and draw
Arrow keysEnter
Take back your last move (and the computer's reply)
Ctrl+ZUndo button

Tips

  • Avoid drawing the third side of a box; your rival takes it.
  • Late in the game every move gives something away. Open the shortest chain first.
  • At the end of a long chain you can leave the last two boxes to your rival so they must open the next chain.

Frequently asked questions

How strong is the computer?

Easy makes loose moves on purpose, Medium looks a few moves ahead, and Hard also leaves the last two boxes of a chain on purpose and plans which side runs out of safe moves first.

Can two people play?

Yes. Pick 2 Players to share one phone or computer. The board never turns; the bar at the top and the glowing board frame show whose turn it is.

Is my game saved?

Yes. An unfinished game is kept in your browser and the start screen offers Continue. Your win streak against the computer is saved too.

Similar games

See all