🎮 Games

Tic Tac Toe

Play a friend on the same device, or take on a computer that has solved the game and cannot be beaten.

Choose an opponent and play.

Current player: X
X wins 0
Draws 0
O wins 0

Frequently asked questions

Can I play tic tac toe against the computer?

Yes. Choose Easy, Medium or Unbeatable. Easy plays at random and can be beaten by anyone, Medium takes obvious wins and blocks obvious threats, and Unbeatable searches the whole game to the end.

Can the hard mode be beaten?

No, and that is not a boast — it is a property of the game. Tic tac toe is small enough to be solved completely, so the computer can see every possible continuation before it moves. Perfect play cannot lose. The best result available to you is a draw.

How does the unbeatable computer work?

It uses minimax: for every legal move it plays out every possible continuation to the end of the game, assumes you will always reply with your best move, and picks the branch with the best guaranteed outcome. With only 255,168 possible games it can examine all of them instantly.

Why does the computer sometimes take longer to win than it could?

It should not. The search is depth-aware, meaning a win in one move scores higher than the same win three moves later, and a loss delayed scores better than a loss now. So it takes the quickest win available and, when it is losing, makes you finish the job properly.

Is it possible to win at tic tac toe if both players play well?

No. Tic tac toe is what game theorists call a solved draw: if neither player makes a mistake, every game ends level. Wins only happen when someone errs, which is why the game is usually outgrown at around eight years old.

What is the best first move in tic tac toe?

The centre. It sits on four of the eight winning lines, more than any other square. Corners are next best at three lines each, and edges are weakest at two. Taking the centre does not guarantee a win, but it gives your opponent the most ways to go wrong.

How do I never lose at tic tac toe?

Follow a simple priority order every turn: win if you can, block if your opponent can win next, take the centre, take a square that creates two threats at once, block a fork, then take a corner and finally an edge. Applied consistently, that will never lose.

What is a fork in tic tac toe?

A move that creates two separate winning threats at the same time. Your opponent can only block one of them, so the other wins. Forks are how nearly all real wins happen, and spotting them a move early is the whole skill of the game.

Does the player who goes first always win?

No, but going first is a real advantage. The first player has more chances to create a fork, so against an imperfect opponent X wins far more often than O. Against perfect play the advantage is not enough, and the game is drawn.

How many possible tic tac toe games are there?

255,168 games can actually be played out, from 26,830 distinct board positions. That is small by the standards of board games — chess has more possible games than there are atoms in the observable universe — which is exactly why tic tac toe can be solved outright.

Can I play two players on the same device?

Yes. Choose Two players and take turns on the same screen. X always moves first, and the board shows whose turn it is.

Is the scoreboard saved?

Yes. Wins, losses and draws are kept in your own browser, so they survive closing the tab. They are tied to that browser on that device and are never uploaded.

How do I reset the score?

Use the Reset score button. It clears the wins and draws while leaving the board ready for a new game.

Does this game work on a phone?

Yes. The board scales to the screen and the squares stay large enough to tap comfortably. Everything works the same as on a desktop, including the saved scoreboard.

Can I play tic tac toe with the keyboard?

Yes. The squares are real buttons, so you can move between them with Tab and play with Enter or Space. That also means screen readers announce the board properly.

Is this tic tac toe game free?

Completely. There is no sign-up, no download and no paid mode. Open the page and start.

Does the game work offline?

Once the page has loaded, yes. Everything runs in your browser with no server involved, so the game keeps working if your connection drops.

Where did tic tac toe come from?

Versions of three-in-a-row go back to ancient Rome, where a game called terni lapilli used three pieces each that players moved around rather than placed. The modern pencil-and-paper name noughts and crosses appears in Britain in the nineteenth century, and the game became an early landmark in computing when OXO ran on the EDSAC in 1952.

How to never lose at tic tac toe

Tic tac toe is a solved game. If neither player makes a mistake, every single game ends in a draw. Wins only happen when somebody errs — so playing well is really about never being the one who does.

Check these in order, every turn. Applied consistently, this never loses:

  1. Win. If you have two in a line and the third square is free, take it. Nothing else matters.
  2. Block. If your opponent has two in a line, take the third square before they do.
  3. Take the centre. It sits on four of the eight winning lines — more than any other square.
  4. Fork. Play a square that creates two threats at once. Your opponent can only block one.
  5. Block a fork. If they are about to create a double threat, occupy that square — or force them to defend by making a threat of your own.
  6. Take a corner, preferably the one opposite your opponent's.
  7. Take an edge. The weakest squares, and the last resort.

Why the centre is the best square

There are eight ways to make a line — three rows, three columns and two diagonals. Squares are not equal, because they do not belong to the same number of them:

SquareLines through itWhy it matters
Centre4Belongs to both diagonals plus the middle row and column. The strongest opening.
Corner3A row, a column and one diagonal. The best reply if the centre is taken.
Edge2Only a row and a column, and no diagonal. Play these last.

This is also why the classic trap works: if your opponent opens in the centre and you answer on an edge, you usually lose. Answer in a corner and you can always hold the draw.

The fork — how games are actually won

Almost nobody loses tic tac toe to a single missed block. They lose to a fork: one move that creates two winning threats at the same time. Only one can be blocked, so the other wins.

The most common example: X takes a corner, O replies on an edge instead of the centre, and X takes the opposite corner. X now threatens along two lines at once and the game is over regardless of what O does next.

Defending is the harder half. When you spot a fork coming, you often cannot simply occupy the square — instead, make a threat of your own. Forcing your opponent to block buys you the tempo to deal with the fork on the following move.

Why the computer cannot be beaten

The Unbeatable setting is not playing cleverly — it is playing completely. There are exactly 255,168 games that can be played out on a 3 × 3 board. That is a small enough number for a computer to examine every one of them before each move.

The technique is called minimax. For each legal move it plays the game to its end in every possible way, assumes you will always answer with your best reply, and then picks the move whose worst outcome is best. Because it can see the whole game, it never walks into anything.

One detail matters more than it sounds: the search is depth-aware. A win in one move is scored higher than the identical win three moves later, and a loss postponed scores better than a loss now. Without that, an opponent will happily decline an immediate win, or concede a game it could have dragged out — which reads to a human as playing badly, even though it never actually loses.

For scale: tic tac toe's 255,168 games are why it is completely solved, while chess — with more possible games than there are atoms in the observable universe — is not.

A very old game

Three-in-a-row games go back a long way. The Romans played terni lapilli, where each player had three pieces and moved them around the board rather than placing new ones — grids scratched into Roman paving still survive. The pencil-and-paper version we know appears in Britain in the nineteenth century under the name noughts and crosses.

It also has an unusually important place in computing history. In 1952 A. S. Douglas built OXO on the EDSAC at Cambridge — a tic tac toe game against the computer, and one of the earliest known video games of any kind. The game has been a standard teaching example for game-search algorithms ever since, largely because it is the simplest game that is genuinely worth solving.

What is this tool?

Use Tic Tac Toe | ToolAdda to complete tasks quickly and confidently in your browser without creating an account or installing software.

How to use

  1. Open the tool and review the interface.
  2. Enter your values, upload a file, or choose the settings you need.
  3. Get your result instantly and download or copy it as needed.

Benefits

  • Fast and private by default.
  • Easy for beginners and professionals.
  • Works smoothly on desktop and mobile.