PublicSoftTools

Tic-Tac-Toe

Play the classic noughts-and-crosses game free in your browser — against an unbeatable computer on three difficulty levels, or a friend in 2-player mode. Live scoreboard and winning-line highlight. No signup.

You (X)0
Draws0
CPU (O)0
Your turn
Get three of your marks in a row — across, down, or diagonally. On Hard, the computer plays perfectly and cannot be beaten, so aim for a draw!

How to Play Tic-Tac-Toe

  1. 1Choose vs Computer (Easy/Medium/Hard) or 2 Players.
  2. 2Take turns placing your mark — X or O — in an empty square.
  3. 3Make three in a row — across, down, or diagonally — to win.
  4. 4Block your opponent's two-in-a-row, and watch the scoreboard tally each round.

The Rules, in Short

Tic-Tac-Toe — known as noughts and crosses in much of the world — is played on a grid of three squares by three. One player is X and the other is O, and they alternate marking one empty square per turn. The first player to line up three of their own marks in a straight line wins immediately; the line can run horizontally along a row, vertically down a column, or diagonally corner to corner. If all nine squares are filled without either player making a line of three, the game is a draw.

The rules could not be simpler, which is exactly why Tic-Tac-Toe is one of the first strategy games almost everyone learns. But beneath that simplicity is a complete, solvable puzzle — and once you understand it, you need never lose again.

Playing the Unbeatable Computer

Our computer opponent comes in three strengths. Easy plays mostly random moves and will grab an obvious win, making it a gentle level for young children. Medium takes any immediate win and blocks any immediate threat, but does not plan ahead, so a thoughtful player can beat it. Hard is different: it plays the mathematically optimal move on every turn using a minimax search, which means it cannot be beaten. Against the Hard computer the best possible result is a draw — a genuinely satisfying goal, because forcing a draw means you played flawlessly too.

The Strategy That Never Loses

Because Tic-Tac-Toe is a solved game, there is a fixed priority of moves that guarantees you will never lose. On each turn, work down this list and play the first one that applies:

  1. 1Win: if you have two in a row with the third square open, complete it.
  2. 2Block: if the opponent has two in a row, take the third square to stop them.
  3. 3Fork: make a move that creates two winning threats at once.
  4. 4Block a fork: stop the opponent from making a double threat.
  5. 5Centre, then corner, then side: otherwise take the centre, then a corner, then an edge.

Follow that order and, at worst, you draw — which is the whole reason two skilled players always tie.

Quick Tips

Take the centre

The middle square is part of four winning lines — more than any other. Grab it first when you can.

Corners beat sides

Corners each belong to three lines; edges to only two. Prefer corners when the centre is taken.

Always block a two

If your opponent has two in a line with the third open, block it immediately — one miss loses the game.

Set up a fork

Aim to create two threats in one move. Your opponent can only block one, so the other one wins.

Watch for their fork

Just as you fork them, they can fork you. Deny the square that would give them a double threat.

Aim for the draw on Hard

The Hard computer is unbeatable, so a draw is a win for you. Play the priority list and you'll hold it.

Frequently Asked Questions

How do you play Tic-Tac-Toe?

Two players take turns marking squares in a 3×3 grid — one plays X, the other O. The first player to place three of their marks in a straight line — across a row, down a column, or along a diagonal — wins. If all nine squares fill up with no line of three, the game is a draw (sometimes called a “cat’s game”).

Can I play against the computer?

Yes. The default mode is you versus the computer, with Easy, Medium, and Hard levels. Easy plays mostly random moves, Medium takes obvious wins and blocks obvious threats, and Hard plays perfectly using a minimax search. Switch to 2 Players to play a friend on the same device, taking turns tapping the grid.

Is the hard computer really unbeatable?

Yes. On Hard the computer plays the game-theoretic optimal move every turn, so it can never be beaten — the best you can achieve is a draw. This is not marketing: Tic-Tac-Toe is a solved game, and our AI has been verified by exhaustively checking every possible opponent line and confirming it never loses as either the first or second player.

How do you never lose at Tic-Tac-Toe?

Follow a simple priority list each turn: first, if you can win now, do it; second, if the opponent can win next turn, block them; third, take the centre if it is open; fourth, take a corner; and finally, take a side. Watch especially for “forks” — positions where the opponent threatens two lines at once — and prevent them. Play this way and you will never lose.

Does the first player always win?

No. With perfect play by both sides, Tic-Tac-Toe is always a draw — neither player can force a win. The first player (X) has a slight practical edge because they control the tempo and can set traps, but a careful second player always avoids losing. That is exactly why the Hard computer draws every game against perfect play.

Does it work on mobile?

Yes. The grid scales to your screen and you play by tapping a square. Everything runs in your browser with nothing to install, and no data is uploaded, so you can even play offline once the page has loaded.

Want the complete strategy? Read our guide on how to never lose at Tic-Tac-Toe.