Skip to content
Tic-Tac-Toe

Tic-Tac-Toe

Advertisement

Tic-tac-toe against the computer at three levels or with a friend on one device. Play on 3×3, or try 4×4 and 5×5 where you need four in a row.

What is tic-tac-toe?

Tic-tac-toe is a two-player paper-and-pencil game in which players take turns marking X and O in the cells of a 3×3 grid, and the first to get three of their marks in a row, across, down or diagonally, wins. In British English it is called noughts and crosses. A game lasts at most nine moves, and with perfect play from both sides it always ends in a draw.

Our version adds two larger boards, 4×4 and 5×5, where you need four in a row. They play quite differently from the classic grid and give the game more room for real strategy.

How to play tic-tac-toe on 3×3, 4×4 and 5×5

X always moves first, and the players then alternate, one mark per turn in any empty cell. Marks are never moved or removed. On the 3×3 board the first line of three wins. On 4×4 and 5×5 you need four in a row in any of the four directions. A full board with no line is a draw.

The boards differ in how many winning lines they have. The 3×3 grid has 8: three rows, three columns and two diagonals. On 4×4, four in a row means a complete row, column or main diagonal, so there are only 10 possible lines, and a single enemy mark in a line kills it for you. On 5×5 each row and column holds two possible lines of four, and the diagonals add more, for 28 lines in total.

Before a game you choose who plays: the computer at Easy, Medium or Hard, with you or the computer moving first, or two players taking turns on one device.

Tic-tac-toe strategy: how to win or never lose

Know the strong cells. On 3×3 the centre belongs to four lines, each corner to three and each edge cell to only two. That is why the best first moves are the centre or a corner.

Open in a corner as X. A corner opening sets the most traps. If O answers anywhere except the centre, X can force a win. If O takes the centre, a draw is the normal result, but O still has to answer every threat correctly.

Answer correctly as O. If X opens in a corner, take the centre. If X opens in the centre, take a corner; an edge reply lets X force a win. If X opens on an edge, the centre is the simplest safe answer.

Win with a fork. A fork is a move that creates two lines with two marks each, both open. Your opponent can block only one. Most wins in tic-tac-toe come from forks, and most losses from failing to see one coming. A classic trap: X holds two opposite corners and O holds the centre. If O now plays a corner, X forks and wins, so O must play an edge to force X to block.

On the larger boards, think in lines. On 4×4 you can stop a line for good with one mark, so the game is mostly about blocking, and draws are common. On 5×5, build in the middle, where cells belong to the most lines, and look for a move that creates two threats of three-with-an-open-end at once. Block any open three before it becomes two threats.

Computer levels and two-player mode

Easy takes a winning cell when it has one and blocks your win only about half of the time; otherwise it plays at random, which makes it a good first opponent. Medium looks two moves ahead, so it blocks every simple threat but can fall for a fork. Hard plays perfectly on 3×3: you cannot beat it there, and a draw is the best result. On 4×4 and 5×5 it searches deeply for up to about a second per move.

In two-player mode the board never turns. A coloured bar above the board and a glow around its frame mark the player to move, so two people can share one phone. Undo, with the button or Ctrl+Z, takes back your last move together with the computer's reply.

The history of tic-tac-toe

Games of three in a row on small grids have been played for a very long time, and tic-tac-toe in its modern form was a common schoolroom game in English-speaking countries by the 20th century. It also has a place in computing history: in 1952 A. S. Douglas wrote a noughts and crosses program called OXO for the EDSAC computer at the University of Cambridge, one of the earliest video games.

Because the game is small, it has been fully analysed. There are 255,168 possible games on the 3×3 board, and perfect play by both sides always gives a draw. In Vietnam the 3×3 game is often called cờ X O, a small cousin of caro, which is played on a large board with five in a row.

Play tic-tac-toe free on Hevagames

Tic-tac-toe runs in the browser on phones, tablets and computers, with no download. Tap or click an empty cell to play, or use the arrow keys to move between cells and Enter or Space to place your mark.

If you leave mid-game, the board stays in your browser and you can pick it up again from the start screen. Wins in a row against the computer count as a streak and are saved, which gives you a reason to keep a run going on Medium or on the larger boards. The game follows the light or dark theme of the site and is available in 30 languages.

How to play

  1. 1Choose vs Computer (Easy, Medium or Hard, and who moves first) or 2 Players, then a board size.
  2. 2X always moves first. Tap an empty cell to place your mark.
  3. 3On 3×3 make three in a row; on 4×4 and 5×5 make four in a row, across, down or diagonally.
  4. 4If the board fills up with no line, the game is a draw.

Controls

Place your mark
TapClick
Move between cells and place a mark
Arrow keysEnter
Take back your last move (and the computer's reply)
Ctrl+ZUndo button

Tips

  • On 3×3 the centre and the corners give you the most lines.
  • A fork, two open lines at once, cannot be blocked with one move.
  • Hard never loses on 3×3; a draw against it is a good result.

Frequently asked questions

How strong is the computer?

Easy makes loose moves on purpose, Medium looks a few moves ahead, and Hard plays perfectly on 3×3 and searches deeply on the larger boards.

Can two people play?

Yes. Pick 2 Players to share one phone or computer. The board never turns; the bar at the top and the glowing board frame show whose turn it is.

Is my game saved?

Yes. An unfinished game is kept in your browser and the start screen offers Continue. Your win streak against the computer is saved too.

Similar games

See all