Dots and Boxes Online

Dots and Boxes Online

Most boxes when every line is drawn wins

Get it on PlaystoreGet it on the AppStore
Create tournament
Daily leaderboard, ends in00:00:00

General ranking since 30 days. Learn more

Dots and Boxes is a pencil-and-paper game for two players. The board starts as an empty grid of dots; the players draw lines between them one at a time, and whoever draws the fourth line around a box claims it. Children play it on graph paper, and mathematicians have written books about it: behind the simple rules lies a strategy of chains, sacrifices and counting that decides most games long before the last box is claimed.

Dots and Boxes rules

papergames.io plays Dots and Boxes under the standard rules, the ones used by clubs and computer competitions.

  • The board is a grid of dots with no lines drawn, the border included. The default 5x5 board has 36 dots, 60 lines to draw and 25 boxes to claim.
  • Players move in turn. A move draws one line between two dots that are next to each other in a row or a column. Diagonal lines are not allowed.
  • When your line is the fourth line around a box, you claim that box and it fills with your colour.
  • A claim earns an extra move: you must draw another line straight away. If that line claims a box too, you move again, and so on. Your turn ends with the first line that claims nothing.
  • One line can claim two boxes at once, when it is the fourth line of both. You get both boxes, but still only one extra move.
  • Claiming is never automatic. A box with three lines stays open until someone draws its fourth line, and you may leave it open on purpose.
  • The game ends when every line is drawn, and with it every box claimed. A claim made with the last line earns no extra move, since there is nothing left to draw.

The Final score

At the end each player counts the boxes they claimed, and the player with more boxes wins. Every box belongs to one player or the other, so on the 5x5 board the Final score always adds up to 25 and 13 boxes are enough to win. A draw is possible only on a board with an even number of boxes: 4x4 can end 8-8 and 6x6 can end 18-18, while 3x3 and 5x5 always have a winner.

Board sizes

Sizes are counted in boxes, and there are four to choose from:

  • 3x3: 9 boxes and 24 lines, for a quick game.
  • 4x4: 16 boxes and 40 lines, a classic size for a casual game.
  • 5x5: 25 boxes and 60 lines, the default, and the size experts and computer competitions play. Matchmaking, the daily tournaments and the choice of robot strength use this board.
  • 6x6: 36 boxes and 84 lines, for a longer game with more chains to fight over.

Playing Dots and Boxes online at papergames.io

  • The lines of the latest turn stay in that player's colour, so you can see everything your opponent drew in their last turn, however many lines it was. Earlier lines are grey.
  • A frame in the mover's colour around the board, and a message under it, show when a player is making an extra move.
  • The score bar above the board shows both counts and how many boxes are needed to win.
  • You can play from the keyboard: the arrow keys move between lines, and Enter draws one.
  • Create a private room at any of the four sizes and share the link with a friend.
  • Play against a robot at the strength that suits you, at any hour.
  • Join the daily tournaments and follow your rating on the global leaderboards.

Dots and Boxes strategy

Beginners claim every box they can and hope for the best. Strong players watch for something else: which player will be forced to open the first long chain. Here is how that works, one step at a time.

Never draw the third line of a box

Early in the game, a line that leaves a box with three lines drawn hands that box to your opponent, who claims it and moves again. A line that leaves no box with three lines is a safe line. As long as safe lines remain, play one of them, and claim any box your opponent leaves you.

Chains and loops

Sooner or later no safe line is left. By then the board has split into chains: rows of open boxes, each with two lines drawn, joined one to the next, so that the first line drawn inside a chain lets the opponent claim every box in it, one after another. A chain of three or more boxes is a long chain. A loop is a chain that closes on itself: it has no open end and always holds an even number of boxes, at least four. From now on, every move gives something away, and the question is who has to give away the long chains.

Keep control with the all-but-two sacrifice

When your opponent opens a long chain, the obvious answer is to claim all of it. The strong answer is to claim every box except the last two, then draw the line at the far end of the chain, which leaves those two boxes with three lines each. That line claims nothing, so your turn ends. Your opponent claims both boxes with a single line, a double-cross, and then has to move again, which means opening the next chain for you. You gave up two boxes to keep control: you will be the one claiming the long chains that follow. A loop costs four boxes instead of two: claim all but the last four, then draw the line that splits those four into two pairs.

Know when to claim everything

Control is worth its price only when there is enough left to win back. Claim the last chain in full. When the chains still to come are short, or would not return more than the boxes you hand over, claim everything as well. Adding up the boxes in the long chains still on the board tells you which choice wins.

The long chain rule

Since the player in control usually wins the endgame, the real fight comes earlier, over the number of long chains. Elwyn Berlekamp's long chain rule says that the first player wants the number of dots plus the number of long chains to be even, and the second player wants it to be odd. Loops do not count. The 5x5 board has 36 dots, so there the first player wants an even number of long chains and the second player an odd number. While safe lines remain, steer the board towards the count you need: join two chains into one, cut one in two, or give away a box or two early if that fixes the count.

Open a two-box chain in the middle

When you have to give away a chain of two boxes, draw the line between them. That leaves two single boxes, and your opponent cannot hand them back to you in a way that keeps control. Draw the line at one end instead, and your opponent can answer with the line at the other end: you claim the two boxes with a double-cross, and then you have to open the next chain.

History of Dots and Boxes

The French mathematician Édouard Lucas published the game in 1889 under the name La Pipopipette. It spread as a schoolroom game played on graph paper, and many countries know it by a name of their own, such as Käsekästchen in Germany or 点格棋 in China. Its strategy was worked out much later. Elwyn Berlekamp, who analysed it in Winning Ways for Your Mathematical Plays and wrote a whole book about it, The Dots and Boxes Game (2000), showed how chains, control and parity decide games between strong players. Today computer programs compete at it in the Computer Olympiad, on the 5x5 board.

Similar games

If you enjoy Dots and Boxes, try Tic Tac Toe, the other great pencil-and-paper classic, and Gomoku, five in a row on a grid. Battleship also began as a game on graph paper, and Reversi rewards the same habit of counting ahead.

Community and tournaments

On papergames.io you can join the daily Dots and Boxes tournaments, climb the leaderboards and meet opponents of every level, from players who still claim every box in sight to those who count the long chains from the first move.

Frequently asked questions

How do you win at Dots and Boxes?

Claim more boxes than your opponent by the time every line is drawn. Avoid drawing the third line of a box, and when the board breaks up into chains, try not to be the player who has to open the first long chain.

Do I have to claim a box when I can?

No. Claiming is never automatic, and you may leave a box with three lines open on purpose. Strong players do it to keep control: they leave the last two boxes of a chain to their opponent, who then has to open the next chain.

What happens after I claim a box?

You must draw another line straight away: that is the extra move. Your turn goes on as long as your lines claim boxes and ends with the first line that claims nothing. A line that claims two boxes at once still earns only one extra move.

Can Dots and Boxes end in a draw?

Only on a board with an even number of boxes. A 4x4 game (16 boxes) or a 6x6 game (36 boxes) can end in a draw, while a 3x3 game (9 boxes) or a 5x5 game (25 boxes) always has a winner.

Is Dots and Boxes a solved game?

Smaller boards are. With perfect play the 3x3 board is a win for the second player, by 6 boxes to 3, and the 4x5 board is a draw (Joseph Barker and Richard Korf, 2012). The 5x5 board, the one played in tournaments, is still unsolved: nobody knows the result of perfect play from the empty board.

Can I play Dots and Boxes against the computer?

Yes. Choose "Play vs robot" and set the robot strength that suits you, from beginner to expert, at any hour.

Is Dots and Boxes free on papergames.io?

Yes, 100% free. You play directly in your browser, on desktop or mobile, and you can play as a guest without creating an account.