See More Games

Play Tic-Tac-Toe Game Online for Free

Tic-tac-toe is a two-player pencil and paper game in which each player takes turns filling in a three-by-three grid with an X or an O.

The player who first places three of their markers in a row, whether horizontal, vertical, or diagonal, wins the game. Even if both players play flawlessly, the game is drawn.

The Tic-Tac-Toe game is played by two players on a grid that is three squares by three squares. Each player takes it in turn to place the symbols X and O in the middle three squares.

While there isn't a hard and fast rule on who has to go first, let's just assume X does.

It doesn't take long for participants to realize that a draw is an optimal outcome for the game. Although people of all ages enjoy a good game of Tic-Tac-Toe, young children are the game's primary audience and may not yet have developed a winning strategy.

The Tic-Tac-Toe clarity is a helpful teaching tool for topics as diverse as sportsmanship and the subfield of AI known as "searching game trees."

Writing a computer software that can play Tic-Tac-Toe correctly, or that can enumerate the game's 26,830 conceivable games up to rotations and reflections (its game tree complexity), or that can enumerate the game's 765 distinct locations (its state space complexity), is a trivial task.

It's pointless to play Tic-Tac-Toe because it will always finish in a tie, even if both players are at the top of their games.

Two players take turns laying stones of their color into an m-by-n board to achieve a streak of k of their color. This game can be generalized to an m,n,k-game. The game with the most possible moves is Tic-Tac-Toe, with three possible moves each.

Tic-Tac-Toe has been further generalized by Harary's version. One can think of it more generally as a game where n=3 and d=2. An arbitrary incidence structure, where rows represent lines and cells represent points, allows for even more generalization.

Each line in Tic-Tac-Toe consists of at least three points, and there are nine points total in the game's incidence structure (three horizontal lines, three vertical lines, and two diagonal lines).

How to Play Tic-Tac-Toe Game Online

Using the same algorithm as Newell and Simon's 1972 tic-tac-toe software, a player can play flawless tic-tac-toe (to win or draw) by selecting the first available move from the list below at the beginning of their turn.

1. Win: With two in a row, the player can place the third card to make a winning straight.

2. Block: If an opponent has two in a row, the player may block by playing the third card.

3. Fork: Cause a split in the game so the player can win in two ways (two non-blocked lines of 2).

4. Block the opponent's fork: If the opponent has only one fork option, the player should block it. If the player wants to make two in a row, they should block every possible fork. If the opponent doesn't have a fork, the player should make two in a row to compel them to defend. If "O" holds the center and "X" has two adjacent corners, "O" cannot win by making a corner move. (A fork gives "X" the win by playing a corner move in this situation.)

5. Center: The center is marked with a player. (If it's the initial move of the game, a corner move may be the best option because it offers the second player more chances to make a mistake; nevertheless, it doesn't matter if both players are perfect.)

6. Opposite corner: If the opponent occupies a corner, the player must go to the other corner.

7. Empty corner: The player occupies a vacant corner square.

8. Empty side: The player plays in a central square on an empty side, which can be any of the four sides.

How the Tic-Tac-Toe Game Started (History)

Ancient Egyptians played games that used three-in-a-row boards, as evidenced by roofing tiles depicting such boards from circa 1300 BC.

Around the 1st century BC, citizens of the Roman Empire played a version of Tic-Tac-Toe that bore striking similarities to modern games.

The game was named Terni Lapilli (three pebbles at a time), and it required players to constantly shuffle their pieces to fill in the board. Scatterings of the game's grid markings can be discovered throughout Rome's streets and sidewalks.

The Puebloan game Picabia and the ancient game three men's morris, in which you need to line up three pieces in a row to win, share many similarities.

The various game titles are relatively recent inventions. The British term for the game first appeared in print in 1858, when it was referred to as "noughts and crosses" (nought being another word for "zero").

In 1884, the phrase "a children's game played on a slate, consisting of striving with the eyes closed to bring the pencil down on one of the numbers of a set; the number hit being scored" appeared in print for the first time.

As an alternative origin, "Tic-Tac-Toe" could be derived from "tick-tack," the name of a pre-modern variant of backgammon that was first mentioned in 1558. Tic-Tac-Toe was renamed "noughts and crosses" in the United States in the 20th century.

An early video game was OXO (or Noughts and Crosses), created in 1952 by British computer scientist Sandy Douglas for the EDSAC computer at the University of Cambridge. In a game of Tic-Tac-Toe, the computer player could easily beat a human opponent.

MIT students also utilized Tic-Tac-Toe in 1975 to showcase the computational capability of Tinkertoy bricks. The Tinkertoy computer, constructed almost entirely of the eponymous building blocks, is unbeatable in the classic game of Tic-Tac-Toe. The Boston Museum of Science is now displaying it.