Dots and Boxes: join the dots, close the most boxes

Take turns drawing lines between dots. Close a box to claim it and move again.

  • Board games
  • 3×3, 5×5, 7×7 boxes · vs computer (3 levels) · 2 players
  • Free

Loading puzzle…

Dots and Boxes, free online

Dots and Boxes is the pencil and paper game many people first played at the back of a school notebook: a grid of dots, two players, one line per turn. Close the fourth side of a box and you claim it and go again. When the grid is full, the player with more boxes wins.

Here you can play the computer on easy, medium or hard, or pick 2 players and pass the phone to a friend. Choose a quick 3×3 board for a two-minute game, the classic 5×5, or a long 7×7 game that rewards real planning. Lines draw on, claimed boxes pop in with your color, and full screen gives you a bigger board.

How to play here

Tap or click between two dots to draw a line. You don’t have to hit the exact spot: the nearest open line to your finger is drawn. You can also drag from one dot to the next. With a mouse, the line you are about to draw shows up as you move over the board.

The score chips at the top show both scores and light up for the player whose turn it is. Undo takes back your last move (against the computer it also takes back the computer’s reply), and Hint shows a line that gives nothing away, or a box you can take.

Which board to pick

The board sizes count boxes, not dots. A 3×3 board has 16 dots and 9 boxes, so a game takes a couple of minutes and is a good way to see the double-cross in action. The 5×5 board, with 36 dots and 25 boxes, is the classic size and the one most strategy guides use. The 7×7 board has 49 boxes and a long safe-line phase, so planning the chains early pays off. Every board has an odd number of boxes, which means there is always a winner and never a draw.

A short history

The French mathematician Édouard Lucas described the game in 1889 under the name la pipopipette. It has been a classroom favorite ever since, and it became a serious study for mathematicians when Elwyn Berlekamp, John Conway and Richard Guy analysed it in their book Winning Ways. Berlekamp later wrote a whole book on it, The Dots and Boxes Game.

Strategy that works

Most beginners play the same way: grab any box they can and avoid drawing the third side of a box. That is a good start, and it is exactly how the medium computer plays. To go further you need to think about what happens when the safe lines run out.

  1. Play safe early. Leave every box with at most two sides drawn for as long as you can.
  2. Watch the chains form. As the board fills up, boxes link into chains and loops. Once someone draws a line inside a chain, the other player can take the whole chain one box after another.
  3. Count long chains. A chain of three or more boxes is long. The long chain rule says the first player wants an even number of long chains on the boards here, and the second player wants an odd number. Make lines that join or split chains to get the count you need.
  4. Sacrifice short chains first. When you must give something away, give a single box or a chain of two. Open a chain of two in the middle, so your opponent can’t use the double-cross on it.
  5. Keep control with the double-cross. When you take a long chain, stop at the last two boxes and draw the far line instead. Your opponent takes two boxes, then has to open the next chain for you. With a loop, leave the last four.

Levels

Easy is for learning the rules and for younger players. Medium plays the beginner strategy well and punishes every third side you draw. Hard knows chains, the long chain rule and the double-cross, and it plays the endgame almost perfectly on the smaller boards. For more two-player strategy, try Four in a Row, Reversi and Checkers.

How to play Dots and Boxes

  1. Players take turns drawing one line between two dots that sit next to each other, across or down. Diagonal lines are not allowed.
  2. When your line closes the fourth side of a box, the box is yours and you must draw another line straight away.
  3. One line can close two boxes at once. You still get just one extra turn.
  4. The game ends when every box is closed. The player with more boxes wins.
  5. Against the computer you go first in the first game, and the first turn then alternates.

Dots and Boxes tips

Never draw the third side of a box

A box with three sides is a free gift. Early on, draw lines that leave every box with two sides or fewer.

Count the long chains

Late in the game the board splits into chains, runs of boxes that fall one after another once someone opens them. A chain of three or more is a long chain. On the boards here, the player who moves first wants an even number of long chains, and the second player wants an odd number. This is the long chain rule.

Give away the short chains first

When every line hands over boxes, open the smallest chain or single box. Save the long chains for the end, when your opponent has to open them.

Learn the double-cross

When your opponent opens a long chain, take every box except the last two, then draw the line at the far end. They get those two boxes with one line, but then they must open the next chain for you. Giving up two boxes to win ten is the key move of the game.

Frequently asked questions

What is the strategy for dots and boxes?

In the opening, avoid drawing the third side of any box. As safe lines run out, try to control how many long chains form (the long chain rule). In the endgame, give away short chains first, and when you take a long chain, keep control by leaving the last two boxes with a double-cross.

Who goes first in dots and boxes?

There is no official rule; players agree or take turns. Here you move first in your first game against the computer, and the first turn then switches every game. In 2 player mode Violet starts the first game.

Is dots and boxes a solved game?

Only on small boards. In 2012 Joseph Barker and Richard Korf solved the board of 4 by 5 boxes by computer and showed that perfect play ends in a tie. The 5 by 5 board most people play has not been solved.

What is the long chain rule?

It is a counting rule from Elwyn Berlekamp. On a board with an even number of dots, like every board here, the first player wants the game to end up with an even number of long chains (three boxes or more), and the second player wants an odd number. The player who gets the count they want usually keeps control at the end.

How strong is the computer?

Easy plays mostly at random and sometimes grabs a free box. Medium takes every box it can and never draws a third side if it can avoid it. Hard counts chains, searches the endgame and uses the double-cross, so you need the long chain rule to beat it.

Can two people play on one device?

Yes. Choose 2 players and take turns on the same screen. Violet and Orange each have their own color, and the score chips show whose turn it is.