Dots and Boxes

Take turns joining two neighbouring dots with a line. Whoever draws the fourth side of a small square claims it and goes again, and the winner is the one holding more boxes when the grid is full.

How to play

Because completing a box gives you another go straight away, one careless line can hand over a whole run of boxes at once, and that is where the game is really decided.

  1. Tap between two dots That draws a line.
  2. Complete a box to go again And again, for as long as you keep completing boxes.
  3. Avoid giving boxes away A line that gives a box a third side lets your opponent take it.
Full instructions

In depth

Winning at dots and boxes against a careful computer

Why the game that looks trivial on paper has a theory behind it, how safe moves decide everything, what chains are and how to control them, and the counting trick that turns the endgame from luck into arithmetic.

Screenshot: How to play Dots and Boxes
How to play Dots and Boxes as it appears when the page opens.

The rules in full

The board is a grid of dots. You and the computer take turns drawing a single line between two dots that sit next to each other, horizontally or vertically. Each line forms one side of one or two boxes. When you draw the line that completes the fourth side of a box, that box becomes yours and you take another turn immediately. If your line completes two boxes at once, you claim both and still go again. The game ends when every possible line has been drawn, and whoever owns more boxes wins.

A draw is possible. On a four by four grid there are sixteen boxes. If each player claims eight, neither wins. The game reports the exact score either way.

Grid sizes

Easy gives you a three by three grid of boxes, which means four by four dots and twenty-four possible lines. Normal is four by four boxes with five by five dots and forty lines. Hard is five by five boxes with six by six dots and sixty lines. The larger the grid, the more room there is for chains, and the more the endgame matters.

On the three by three grid the entire game takes a dozen moves and mistakes are obvious. It is a good place to learn the safe-move rule. On the five by five grid the middle game is long enough that you can practise counting safe moves before anything is forced.

Controls

Tap the space between two neighbouring dots and a line appears. If the line completes a box, your initial fills the box and you go again. Otherwise the computer takes its turn after a short pause.

Lines already drawn cannot be removed. Every move is permanent. The stats bar shows your box count, the computer's box count, and how many boxes remain unclaimed. The New game button starts a fresh grid at whatever size is selected.

What a safe move is

A safe move is a line that does not give any box its third side. Why the third? Because a box with three sides is a gift. Whoever draws the fourth side takes it, and your opponent will certainly draw that fourth side on their next turn. So every time you add a third side to a box, you are handing it over.

The entire middle of the game is about playing safe moves and avoiding unsafe ones. Count the sides on every box near the line you are thinking of drawing. If neither of the boxes it touches would reach three, the move is safe. If either would, pick a different line.

As the grid fills up, safe moves get scarce. Eventually a point comes where every remaining line gives something away. That is where the real strategy begins.

Chains and why they decide the winner

A chain is a row of boxes where each one already has two sides drawn. When someone draws the third side of the first box in a chain, the opponent takes it by drawing the fourth side, and that fourth side is simultaneously the third side of the next box in the chain. So the opponent keeps going, taking the whole chain in a single turn.

Imagine a chain of five boxes. You draw one line and give the computer the first box. The computer draws the fourth side of box one, which gives box two its third side, so the computer takes box two as well. This keeps going until all five are claimed. You lost five boxes for one move.

Short chains are less expensive. A chain of two costs you two boxes. A chain of one costs you just one. When you have no safe moves left and must open a chain, open the shortest one available. You lose the least that way.

Parity and the counting game

Strong players count how many safe moves remain on the board. The player who makes the last safe move forces the opponent to open the first chain. That opponent then gives away boxes, and the chain-taker usually rides the momentum to the end.

Say eight safe moves remain and it is your turn. You play one, leaving seven. The computer plays one, leaving six. You play one, five left. The computer plays one, four left. You play one, three. Computer, two. You, one. Computer has none and must open a chain. You wanted that.

If the count is odd and it is your turn, the last safe move will be yours. If it is even, the last safe move will be the computer's. When the parity is against you, consider sacrificing a small chain deliberately. Giving away two boxes early can flip the count and hand the opponent the burden of opening the big chain later.

Parity is harder to track on the five by five grid because there are sixty lines and many safe options in the early game. Practice on the three by three first, where the total is small enough to count on your fingers. Once the habit sticks, the larger grids feel less overwhelming.

The double cross

When the computer opens a chain of four or more, you do not have to take every box in it. You can take all but the last two, then leave the final two for your opponent by drawing the line that divides them rather than taking the second-to-last box. This is the double cross.

What does it gain you? You get most of the chain, and then your opponent is stuck with two easy boxes but must also open the next chain. You keep control. Against a computer that understands chains, this move is the way to stay ahead when multiple chains remain.

Use the double cross only when there is another chain on the board waiting to be opened. If the chain you are taking is the last group of boxes, just take them all.

How the computer plays

The computer follows three rules in order. First, it takes any box it can complete right now. Second, if no box is ready, it plays a safe move at random from whatever safe moves remain. Third, if every line gives something away, it picks at random and hopes.

The computer is disciplined about rule two. It will never hand you a free box if a safe move exists, and that alone makes it a stronger opponent than most casual players. What it does not do is count chains or use the double cross. It does not plan several moves ahead. It reacts to the board as it is, one turn at a time.

That means you can beat it by thinking further ahead. If you track the safe-move count and plan which chains to open, you have an edge the computer cannot match.

Mistakes that hand the computer a win

  • Drawing the third side of a box without realising it. Before every move, count the sides on both boxes the line touches. If either is at two, your move brings it to three and the computer will take it next.
  • Grabbing one box by completing a short chain early, then finding you have run out of safe moves. An early box feels good but costs you parity.
  • Ignoring chain length when you must open one. Always open the shortest chain first. Five boxes lost is much worse than two.
  • Taking every box in a long chain instead of using the double cross. Leaving the last two costs you two boxes but can save you ten later by keeping control.
  • Thinking the game is simple because the rules are simple. Most people learn the rules in a minute and then lose for years until they learn safe moves.

Reading the board at a glance

Completed boxes show who owns them. Your boxes display one colour and the computer's display another, with initials inside. The dot grid scales to fit your screen, so the lines are large enough to tap on a phone without hitting the wrong gap.

After the computer moves, a note underneath the board says whose turn it is. If you complete a box, the note tells you to go again. This feedback keeps the flow clear even when several boxes are taken in a row during a long chain.

Nothing leaves your browser

The game runs entirely on your own device. The computer opponent is a short piece of code inside the page, not a remote server. No move you make is sent anywhere, and your best score is stored in this browser only. You can disconnect from the internet and play as many games as you like. The page does not need a connection after it has loaded.

Help

How to play Dots and Boxes

Because completing a box gives you another go straight away, one careless line can hand over a whole run of boxes at once, and that is where the game is really decided. Play carries on until every line between neighbouring dots has been drawn, so no square is left unclaimed. The count at the end is all that matters.

Tap between two dots

That draws a line.

Complete a box to go again

And again, for as long as you keep completing boxes.

Avoid giving boxes away

A line that gives a box a third side lets your opponent take it.

Watch the endgame

Eventually every line gives something away. Then it is about giving away as little as possible.

Claim the most boxes

The grid fills up and the boxes are counted.

Runs on your device

The whole game is played inside this page. Nothing is uploaded, there is no account, and your best score is stored in this browser only. Once the page has loaded it works offline.

Good to know

Count the third sides

Never draw a line that gives any box its third side, unless you have no choice. That single rule is most of the game.

The endgame is about chains

When all safe moves are gone, you have to open a chain of boxes. Open the shortest one — you lose least.

Grabbing boxes early is a trap

The player who runs out of safe moves first loses the endgame, and that is usually the one who was greedy in the middle.

Parity decides it

Experienced players count how many safe moves are left and make sure it is their opponent who runs out first.

Common questions

Do I really go again after a box?
Yes, and again after that if you complete another. Long chains can be taken in one turn.
Why did the computer suddenly take five boxes?
You gave it the start of a chain. Once one box in a chain is opened, all of them can be taken in a single turn.
What is a safe move?
A line that does not give any box its third side. Playing only safe moves for as long as possible is the core strategy.
Is it free?
Yes — no account, no limit on how many games you play, and no ads inside the game area itself. Ads on the page around it pay for the site.
Does it work on a phone?
Yes. The board scales to your screen and the controls are made big enough to use with a thumb.
Where is my best score kept?
In your browser on this device. It is never sent anywhere and will not follow you to another computer.