Tic tac toe is a two-player game on a 3×3 grid: one player marks X, the other O, and whoever lines up three of their marks first wins. It is one of the best-known games in the world, and its story is a long one. Related games were played in the ancient world, and in 1952 tic tac toe became one of the first games ever shown on a computer screen.

The rules at a glance

  • Two players take turns on a grid of 9 squares.
  • One plays X and the other O. X usually goes first.
  • On each turn you place one mark in an empty square.
  • The first player to get three in a row, across, down or diagonally, wins.
  • If all 9 squares fill up without a line of three, the game is a draw.

A game lasts between 5 and 9 moves and is usually over in less than a minute. That's why tic tac toe gets played everywhere: on scrap paper, on school desks, in the sand or on a phone.

Ancient grids: Egypt and Rome

Grids for three-in-a-row games have been found carved into the roofing slabs of a temple at Kurna in Egypt. They are often dated to around 1300 BC, although some researchers argue they cannot be dated with any certainty. We don't know what rules were used, only that the layout looks a lot like today's board.

In Roman times people played a related game called terni lapilli ("three pebbles"). Each player had only three pieces; once all of them were on the board, players kept going by moving them to empty spots until someone made a line. It was a game of moving pieces, not just placing them.

The Middle Ages: the morris games

In medieval Europe the morris family of games, in which players try to form rows of three pieces, was hugely popular. The smallest of them, three men's morris, is played on a board with 9 points and was popular in England in the 13th century. Its boards have been found carved into the cloister seats of English cathedrals, including Canterbury, Gloucester and Salisbury.

As in terni lapilli, the pieces are placed first and then moved. Modern tic tac toe is the simplest form of the same idea: you only place marks, until the board is full.

Where the names come from

In Britain the game is called noughts and crosses, a name that first appears in print in 1858. The American name has a stranger history: the first printed mention of "tick-tack-toe," in 1884, described a different children's game played on a slate, in which you tried to bring your pencil down on a number with your eyes shut. In the United States the name moved over to the X-and-O game during the 20th century.

Other languages have their own names: tres en raya in Spanish, morpion in French, tris in Italian, krestiki-noliki ("little crosses and noughts") in Russian, and trílisa (τρίλιζα) in Greek, the name this site is built on.

1952: tic tac toe goes digital

In 1952 Alexander "Sandy" Douglas, a doctoral student at the University of Cambridge, wrote OXO, a noughts and crosses game for EDSAC, one of the first stored-program computers. The game was part of his thesis on human-computer interaction.

The board appeared on a small 35×16 dot cathode-ray tube display, and the player picked a square with a rotary telephone dial. The computer played a perfect game. OXO is one of the earliest known games to show graphics on an electronic screen, and some definitions count it among the first video games ever made.

Why mathematicians love it

Tic tac toe is a "solved" game: we know that if both players make no mistakes, the game always ends in a draw. There are 255,168 possible games, or 26,830 if you treat games that differ only by rotating or mirroring the board as the same. A modern computer can check every one of them in a fraction of a second.

ResultNumber of games
First player wins131,184
Second player wins77,904
Draw46,080
Total255,168

That's why tic tac toe is so often the first example in courses on game-playing algorithms such as Minimax, which looks at every possible continuation and picks the best one. The Hard level of our tic tac toe game uses the same algorithm, so the best you can do there is a draw.

Popular variants

  • Super Tic Tac Toe (also called Ultimate Tic Tac Toe): nine small games inside one big board, where your move decides where your opponent plays next. See the Ultimate Tic Tac Toe rules.
  • Reverse tic tac toe: the first player to make three in a row loses.
  • Gomoku: on a large board, the first to get five in a row wins. On Triliza.net it's played on a 15×15 board on the Gomoku page.

Frequently asked questions

How old is tic tac toe?

Three-in-a-row games were already played in the ancient world. The noughts-and-crosses form appears under that name in print in 1858.

Can anyone always win at tic tac toe?

No. With correct play from both sides the game ends in a draw. You can, however, make sure you never lose: our tic tac toe strategy guide shows how.

Where can I play tic tac toe online?

On Triliza.net you can play for free with no sign-up: against the computer at three levels, with a second player on the same screen, or with a friend through a link. For young children there's tic tac toe for kids, with animals instead of X and O.

Sources: Tic-tac-toe (Wikipedia) · Three men's morris (Wikipedia) · OXO (Wikipedia) · Jesper Juul, 255,168 ways of playing Tic Tac Toe