↑↓ to move ↵ to open Esc to close Browse all tools

Dots and Boxes

Join the dots, close boxes and claim them with your initial. Play the computer on three levels or 2 to 4 people on one device, or print a dot grid.

Embed

Play dots and boxes

Grid
Level
First move

    Use the arrow keys to move between lines and Enter or Space to draw one.

    Print a blank dot grid

    One page with the dots and a score table for pen-and-paper play.

    Runs in your browser. Names and moves stay on this device.

    Dots and Boxes by Freebiefy, free online tools · Privacy · Legal notice

    Embed this tool on your site

    Paste this code into your page. The tool runs in the visitor's browser, free and without signup. The height adjusts to the content. All tools you can embed

    Dots and boxes rules

    The game starts with a square grid of dots. Players take turns, and each turn draws one line between two dots that are next to each other, across or down, never diagonally. When a line closes the fourth side of a box, the player who drew it claims the box, writes an initial in it and must draw another line. One line can close two boxes at once, and both count. A line that closes nothing ends the turn. When every box is claimed, the player with the most boxes wins.

    The grid size is counted in boxes here. A 4 × 4 grid has 16 boxes, so 5 dots on each side and 40 lines in total. With 16 boxes two players can tie at 8 each; on the 3 × 3 and 5 × 5 grids an odd number of boxes rules out a tie between two players.

    GridDotsLinesBoxes
    3 × 316249
    4 × 4254016
    5 × 5366025
    6 × 6498436

    Strategy: safe lines, chains and control

    Early in the game most lines are safe: they do not give any box its third side. Drawing the third side is a gift, because the next player closes the box and moves again. So the first part of the game is a race of safe lines, and the player who runs out of them first has to give something away.

    By then the board has split into chains, rows of boxes with two sides each where taking one box opens the next, and loops, chains that close on themselves. The player who has to move opens the shortest one they can. The other player takes the boxes, but has to move again afterwards, and so must open the next chain.

    Elwyn Berlekamp's book The Dots and Boxes Game: Sophisticated Child's Play (A K Peters, 2000) describes the key trick. When you are handed a long chain, take all of its boxes except the last two, then draw the line at the far end so that those two boxes form a pair closed by one line. Your opponent takes the pair, and has to open the next chain for you. Berlekamp calls this a double-dealing move, and the single line that then takes both boxes a double-cross. Giving up two boxes each time keeps you in control, which pays off when the chains left are long. In a loop the same idea costs four boxes. His long chain rule ties the number of long chains each player should aim for to the number of dots on the board, so the fight in the middle of the game is about how many long chains there will be.

    A chain of two is the exception: open it with the middle line, so each box has three sides on its own. Then the other player cannot hand the pair back to you.

    The computer levels

    • Easy takes any box it can close. Otherwise it draws a random line, so it often draws third sides and gives you boxes.
    • Medium takes every box it can and never draws a third side while a safe line is left. When none is left, it opens the chain that gives you the fewest boxes.
    • Hard does all that. When twelve or fewer safe lines are left, it plays every order of them out to see who will have to open the first chain, and picks the line that leaves you that job. In the end game it counts the chains and loops, decides whether to take a whole chain or leave you the last two boxes, and opens chains of two with the middle line.

    Pen-and-paper play

    The PDF under the game prints an empty dot grid from 5 × 5 to 10 × 12 boxes on US Letter or A4, with a score table for 2 to 4 players. Each player uses their own pen color or writes an initial in each box they close. Larger grids make longer games: a 10 × 12 grid has 120 boxes.

    How to play dots and boxes online

    1. 1Choose Against the computer or Friends on one device, then the grid size, the level or the number of players.
    2. 2Type names if you like. Their first letters mark the boxes each player claims.
    3. 3Tap the gap between two dots to draw a line, or use the arrow keys and Enter. Close a box to claim it and move again.
    4. 4Undo takes back the last line (against the computer, your last line and the computer's answer). New game starts over.

    Frequently asked questions

    How do you play dots and boxes?

    Players take turns drawing one line between two dots that sit next to each other, across or down. Whoever draws the fourth side of a box claims it and must draw another line. A line that closes two boxes at once scores both. When every box is claimed, the player with the most boxes wins.

    Do I have to move again after I finish a box?

    Yes. In the usual rules, completing a box is not optional and the player who completed it must draw another line right away. This page follows that rule: the turn stays with you after every box you finish, and passes on after a line that finishes nothing.

    What do Easy, Medium and Hard do?

    Easy takes any box it can finish and otherwise draws a random line, so it often gives you boxes. Medium also takes every box it can, but it never draws the third side of a box while a safe line is left. Hard plays like Medium early on, plays out the last few safe lines to fight for control, and at the end leaves you the last two boxes of a long chain when that wins it more boxes later.

    What is a chain and why does it matter?

    A chain is a row of boxes that each have two sides drawn, linked so that taking one box opens the next. Once the safe lines run out, someone has to open a chain. Elwyn Berlekamp's book The Dots and Boxes Game explains why the player in control should take all but the last two boxes of a long chain and leave those two, so the opponent has to open the next chain.

    Can 3 or 4 people play?

    Yes. Pick Friends on one device and choose 2, 3 or 4 players. Type a name for each player; the first letters become the initials in the boxes, and every player gets a color. The highlighted name shows whose turn it is.

    Can I print a dot grid?

    Yes. Under the game, pick a grid from 5 × 5 to 10 × 12 boxes, the paper size and the number of players, then press Download PDF. You get one page with the dots and a small score table.

    Can I play with a keyboard?

    Yes. Press Tab to reach the board, move between lines with the arrow keys, and press Enter or Space to draw the line in focus. Each line has a label such as "Top of box row 1, column 2, free", and the status line announces every move and every box.