Play tic tac toe online

Get three in a row to win: tap a square or use your keyboard. Play the computer at three levels or a friend on the same device – the score is kept for you.

0
Draws
0
0

Keyboard: arrow keys pick a square, Enter or Space plays it; 1–9 play directly (1 = top left, 9 = bottom right).

Score and settings are stored only in this browser (localStorage).

Result

How it is calculated

How to play tic tac toe

Tic tac toe (also called noughts and crosses or Xs and Os) is played on a 3 × 3 grid. Two players take turns placing their mark, X or O. The first to get three marks in a row – across, down or diagonally – wins. If all nine squares are filled without a line, the round is a draw.

  1. Choose a mode: “vs computer” (you play X) or “2 players” on one phone, tablet or computer.
  2. Who starts: you, the computer, or take turns – with “Take turns” the other side opens every new round.
  3. Pick a square: tap or click it; on a keyboard use the arrow keys and Enter, or press 1–9.

The three computer levels

Why does perfect play always end in a draw?

Tic tac toe is a solved game: if both sides play without mistakes, nobody wins. There are only 765 essentially different positions, so a computer can check them all in a split second – which makes the game a classic first example of game AI.

Tips to win more often

Score and privacy

Wins, losses and draws are counted separately for “vs computer” and “2 players” and stored in your browser’s localStorage. Nothing is sent to a server. The computer’s random choices come from the browser’s cryptographic random number generator.

More games: Hangman, flip a coin or the score keeper for game night.

Frequently asked questions

Can you beat the unbeatable level?

No. It searches every possible game and always plays a best move. With perfect play you can reach a draw – that is the best anyone can do against perfect tic tac toe.

How do I beat the medium level?

Set up a fork: start in a corner and create two open lines of two at the same time. The computer can only block one of them.

Can two people play on one device?

Yes. Choose “2 players” – X and O take turns on the same phone, tablet or computer. The score for this mode is kept separately.

Who starts with “Take turns”?

The side that did not start the previous round. The very first round starts with X.

How do I play with the keyboard?

Arrow keys move the selection and Enter or Space places your mark. Faster: press 1–9, where 1 is top left and 9 bottom right. When a round is over, Enter starts a new one.

Is my score saved?

Yes, only in your browser (localStorage). It survives a page reload; “Reset score” sets it back to 0.

How many possible games of tic tac toe are there?

There are 255,168 possible games, but only 765 essentially different positions once rotations and reflections are merged.

Sources and legal basis

As of:

Related tools