Free classic games for your browser

Tic Tac Toe

Get three in a row before your opponent does — play the computer on three levels or a friend on the same device.

Loading Tic Tac Toe…

Tic tac toe is the classic game where two players take turns placing X and O on a 3×3 grid and try to get three in a row. This is a free tic tac toe game you can play online in your browser, with no download or sign-up.

You can play against the computer on three levels, or against a friend on one device by taking turns on the same board. The game runs entirely in your browser, and nothing you do is sent anywhere. It works on phones as well as desktop computers.

Use it to practise the game, test your strategy, or see whether you can beat the Hard computer, which never loses.

How to play tic tac toe online

  1. Open the Opponent control and choose “vs Computer” to play alone, or “2 players” to play with someone on the same device.
  2. If you chose vs Computer, pick a Level: Easy, Medium or Hard (unbeatable). Hard is the default.
  3. Under You play, choose “You are X (move first)” or “You are O (move second)”. X always moves first, so choosing O means the computer opens.
  4. Click or tap an empty cell to place your mark.
  5. Or use the keyboard: press the digits 1 to 9 to place a mark directly. The numbers follow reading order, so 1 is top left and 9 is bottom right.
  6. To move a visible cursor around the board, use the arrow keys, then press Enter or Space.
  7. Press H for a hint, U or Ctrl+Z (Cmd+Z on a Mac) to undo, and N to start a new game.
  8. When a line of three is made, the winning cells are highlighted and a dialog shows the result. The score chips above the board add it to your tally for the current mode and level, and they stay when you start the next game.

Press F to switch to fullscreen and Esc to leave it. Changing Opponent, Level or You play starts a new game.

Tic tac toe rules

The rules of tic tac toe are simple. Players take turns placing their mark, X or O, in an empty cell of a 3×3 grid, and X always goes first. The first player to get three of their own marks in a row wins.

A row counts horizontally, vertically or diagonally. That gives eight winning lines in total. If all nine cells fill up and neither player has a line, the game is a draw.

How to win tic tac toe: the winning strategy

You win by creating two threats at once, which is called a fork. A threat is two of your marks on a line with an empty third cell, so the opponent must block it or lose. When you make two threats in one move, they can only block one.

Before each move, check the board in this order: win if you can, block the opponent’s winning cell, then look for a fork. Blocking a fork is also important, because a fork is the most common way to lose.

Here is an example from the game’s own logic. X has the top-left and top-middle cells, and O has the middle-left and centre cells, with X to move. X should take the top-right cell, which completes the top row. On the keyboard that is key 3.

Tic tac toe strategy going first

Playing X is an advantage in tempo, but with perfect play it still ends in a draw. The game’s solver shows that every one of the nine opening cells draws against perfect replies. That means you cannot lose with any first move, provided you respond correctly afterwards.

The centre is a practical first choice. It lies on four of the eight lines, more than any other cell, so it gives you the most ways to build a threat. A corner is also a strong opening, and it gives you a good chance of a fork if your opponent errs.

Tic tac toe strategy going second

Going second means you must reply accurately to every opening. If X takes the centre, reply in a corner, because an edge reply loses. If X takes a corner, reply in the centre. If X takes an edge, reply in the centre, which keeps the game safe.

After that, block every threat as it appears and watch for any fork X can build.

Tic tac toe optimal strategy

Optimal play means choosing a move that cannot lose. In tic tac toe, optimal play from both sides always results in a draw. The Hard computer uses minimax, which checks every possible continuation of the game, so it always finds the best move.

To confirm this, the game was checked against every possible reply sequence. Hard played as X in 73 games and as O in 569 games, and it lost none of them. Among equally good moves, it chooses at random, so its opening can vary between games.

Tic tac toe tricks

Against a human, the most useful tricks come from forcing the opponent to respond. Make a threat that they must block, and use that forced move to set up a fork on your next turn. Tricks like this do not work against Hard, but they are effective against Medium, which blocks threats but can be beaten by a fork.

If you want to check your reasoning, press H. The hint always shows a perfect move for the side to move, and it appears only on your turn.

Frequently asked questions

Is tic tac toe free, and do I need to sign up?

Yes, it is free, and there is no sign-up. The game runs in your browser, and nothing you do is sent to a server.

Tic tac toe meaning: what is the game called elsewhere?

Tic tac toe is simply the name of this game of X and O on a 3×3 grid. In Britain and many other countries the same game is called noughts and crosses.

Can I play tic tac toe on a phone?

Yes. The board resizes to fit the width of your screen, so it stays usable on small phones. Tap an empty cell to place your mark.

Is my game saved?

Yes. The game in progress is saved after every move, so it comes back after a reload, even if the game has finished. Your Opponent, Level and You play settings are saved too.

What happens to my score?

Your score is counted per mode and kept in this browser. Vs Computer is tracked separately for each level, and 2 players has its own tally. New game does not reset the score, and there is no reset button, so it stays until you clear your browser data.

Can I beat the Hard computer?

No. Hard plays perfectly and never loses, so the best you can get is a draw. Medium can be beaten by a fork, and Easy picks random cells, so it often misses an obvious win or block.

What does undo do?

In 2 players, each press takes back one mark. Against the computer, undo goes back to your previous turn and takes back both the computer’s reply and your move. If you play O, the computer’s opening move is never taken back.

Can I use the keyboard to play?

Yes. Press the digits 1 to 9 to place a mark, or move the cursor with the arrow keys and press Enter or Space. Press N for a new game, U to undo, H for a hint, and F for fullscreen.

More games

  • Dots and Boxes: a pencil-and-paper style game where you claim boxes by drawing lines between dots.
  • Reversi: a two-player board game where you flip your opponent’s pieces by surrounding them.
  • Mancala: a counting and sowing game played with pits and stones.
  • Hangman: a word-guessing game where you try to find the hidden word before running out of guesses.
  • Memory Game: a matching game where you find pairs by remembering where cards are.
  • Pong: a classic arcade game where you bounce a ball back and forth with a paddle.
  • Dice Game: a game of chance where you roll dice and see how the numbers fall.
  • Peg Solitaire: jump pegs over each other until only one is left on the board.