Skip to content
JustTools

Tic Tac Toe

Play the classic X and O game against the computer — from easy to unbeatable — or with a friend on the same screen, on boards from 3×3 up to 6×6.

Runs in your browser Free · no sign-up

At a glance

  • Play against the computer on Easy, Medium or Hard, or with a friend taking turns on the same phone, tablet or computer.
  • On the classic 3×3 board, Hard plays perfectly and never loses — the best anyone can do against it is a draw.
  • Bigger boards for a longer game: 4×4, 5×5 and 6×6, with 3, 4 or 5 in a row to win.
  • Classic Tic Tac Toe has 255,168 possible games: X wins 131,184, O wins 77,904 and 46,080 end in a draw. With perfect play it is always a draw.
  • Hints, undo, sound, full screen and keyboard play; scores are kept for each mode and board on your device. Free, with no download or sign-up.

Step by step

How to play Tic Tac Toe

  1. 1

    Choose an opponent

    Pick Computer and a difficulty, and whether you play X or O — or pick A friend to play on the same device.

  2. 2

    Choose a board

    Keep the classic 3×3 board, or try 4×4, 5×5 or 6×6 and choose how many in a row it takes to win.

  3. 3

    Take turns

    Tap an empty square to place your mark. The first to complete a line across, down or diagonally wins; a full board with no line is a draw.

  4. 4

    Play again

    Press Play again for the next round — the score keeps adding up. Use Hint or Undo while you learn.

Features

Everything you need, nothing you don’t

Three difficulty levels

Easy for young children, Medium for a fair fight, and a Hard opponent that never loses on 3×3.

Two players, one device

Pass and play with a friend, with your own names and a running score.

Bigger boards

Try 4×4, 5×5 or 6×6 with 3, 4 or 5 in a row — the computer thinks several moves ahead.

Learn as you play

Ask for a hint to see the best move, or take a move back and try another idea.

Fair starts

The first move swaps sides every round, so nobody always has the advantage.

Plays anywhere

Works on phones, tablets and computers, with keyboard controls and screen reader announcements.

The rules

Two players take turns placing their mark — X or O — in an empty square of a 3×3 grid. The first player to get three of their marks in a row, column or diagonal wins. If all nine squares fill up with no line, the game is a draw.

The game is also called noughts and crosses in Britain and zero kata in India. On bigger boards the idea is the same, but you need the number in a row shown under the board.

How to never lose at 3×3

  • No first move wins by force: with best play from both sides, every opening ends in a draw.
  • If your opponent starts in a corner, take the centre — every other reply loses against perfect play.
  • If they start in the centre, take a corner. Answering on an edge loses.
  • If they start on an edge, take the centre, a corner next to their mark, or the edge opposite it.
  • On every turn, first look for a winning move, then block any two-in-a-row of theirs.
  • Win with a fork: a move that makes two lines of two at once, so your opponent can only block one.

Tic Tac Toe by the numbers

Classic 3×3Count
Possible games (until someone wins or the board fills)255,168
… won by X (who moves first)131,184
… won by O77,904
… drawn46,080
Positions that can occur in a game5,478
Different positions, counting rotations and mirror images once765
Result with perfect playDraw

FAQ

Frequently asked questions

Can you beat the computer on Hard?

Not on the 3×3 board: Hard plays perfectly, so the best possible result is a draw. On bigger boards it looks several moves ahead in about a second per move, so strong players can still win.

How do I play with a friend?

Choose A friend under Play against, add your names if you like, and take turns on the same phone or computer. Playing over the internet on two devices isn’t available.

Who goes first?

X moves first in a normal game. With Take turns going first switched on (the default), the first move swaps between the players every round, which keeps things fair.

Is Tic Tac Toe always a draw?

With perfect play by both players, yes — the classic 3×3 game always ends in a draw. Games are won when someone misses a block or falls for a fork.

Is it free, and does it need the internet?

It’s free with no download or sign-up. Once the page has loaded, the game runs entirely in your browser, so it keeps working if your connection drops.

Are my scores saved?

Yes, in this browser only, with a separate score for each mode, difficulty and board size. Reset score clears the one you are playing.

Keep going

Browse every tool

Last updated Report a problem or suggest a feature