On this page: Rules · Easy, Medium and Hard · Buttons and scores · How to win · FAQ
How to play Tic Tac Toe
Players take turns marking an empty square, one with X and the other with O, and whoever gets three marks in a row first wins. In British English the game is called noughts and crosses. That name first appeared in print in 1858, and in 1952 a version called OXO, written for the EDSAC computer at the University of Cambridge, became one of the first known video games.
- Each turn, put your mark in one empty square. A marked square stays marked.
- Three in a row wins. The row can run across, down or corner to corner, so the board has 8 winning lines.
- When all nine squares are full and neither side has a line, the game is a draw. Players call that a cat's game.

Play against the AI or with 2 players on one device
With vs AI picked, you play the computer. You are X unless you pick O next to Play as; that switch waits for the next game, and the screen shows "from next game" until it starts. With 2 Players picked, two people share one phone, tablet or computer, and the status line says whose turn it is. Both players need to be at the same device, because the page can't connect you to someone on another one.
Who moves first
The rules don't say who starts. Here, X opens the first game, and then the first move changes sides with every new game, including the new game you get when you switch mode or level. If you keep the same mark against the AI, it opens every second game.
Easy, Medium or Hard: how the AI plays
The level decides how the AI picks its square. It answers no faster than 0.35 seconds, so you can see its move land. The level is not saved: the page opens on Medium, unless you arrive from another board's page, which passes its level on. Changing the level starts a new game.
| Level | How the AI picks a square | Can you beat it? |
|---|---|---|
| Easy | Any empty square, at random. | Yes. It blocks you only by luck. |
| Medium | Completes its own line if it can, then blocks yours, and otherwise picks at random. | Yes. It can't see a fork coming. |
| Hard | Looks at every move to the end of the game and takes a best one, picked at random when several are equal. | No. A draw is the best you can do. |
Hard never loses on this page. The site's tests play every possible answer against it, with Hard moving first and moving second, and it loses none of those games. Medium loses often: when we had a perfect player open 2,000 games against Medium, the perfect player won 1,552 of them (78%) and drew the rest. The exact count changes from run to run because both sides pick some moves at random.
How to win at Tic Tac Toe
Tic Tac Toe is a solved game: if neither player makes a mistake, it ends in a draw. You win only when the other player makes one, so the tips below help you set up those chances and avoid mistakes of your own.
We counted every possible game with this page's rules code, from the empty board until someone wins or the board fills, with X moving first. There are 255,168 of them. X wins 131,184, O wins 77,904, and 46,080 end in a draw.
| Square | Winning lines through it |
|---|---|
| Center | 4 |
| Each corner | 3 |
| Each edge | 2 |
First moves
All nine first moves lead to a draw with perfect play. They differ in how many ways the other player can go wrong. We checked every reply with a perfect search on this page's rules code:
- After a corner opening, the center is the only reply that doesn't lose. That is why a corner is a good first move against a weaker player.
- After a center opening, any corner is safe. An edge reply loses.
- After an edge opening, four replies are safe: the center, either corner beside that edge, or the edge across from it.
On every turn
- Finish three in a row if you can.
- If the other player has two in a row with the third square empty, block that square.
- If neither applies, look for a fork. A fork is one move that makes two lines that each need one more mark. The other player can block only one of them.

Medium plays steps 1 and 2 but not step 3, which is how you beat it. In the game above, O blocked the middle-left square and X finished the diagonal.

Tic Tac Toe FAQ
Can I play Tic Tac Toe online for free?
Yes. Tic Tac Toe on this page runs in your web browser for free, with no account and nothing to download. You play the AI or a friend on the same device; the page can't connect two devices.
Can I play Tic Tac Toe with a friend?
Yes, on the same phone, tablet or computer. Pick 2 Players and pass the device between turns. There is no way to play someone on another device from this page.
Can you beat the AI?
On Easy and Medium, yes. Medium misses forks, so a move that makes two threats at once beats it. Hard plays perfect moves and never loses, so the best you can get against Hard is a draw.
Can I play as O against the AI?
Yes. Pick O next to Play as. The change starts with the next game, and the screen says "from next game" until then.
Who goes first in Tic Tac Toe?
The rules don't fix it. On this page X moves first in the first game, and after that the first move switches sides with every new game.
Is Tic Tac Toe a solved game?
Yes. With perfect play from both sides it ends in a draw. Counted with this page's rules code, there are 255,168 possible games from the empty board to the end.
What is a cat's game in Tic Tac Toe?
A cat's game is a draw: all nine squares are filled and nobody has three in a row.
Does the game save my score?
Yes, on this device only. Every board except 100×100 keeps one score per level and one for 2 Players, and the scores stay after you close the page. If your browser blocks site storage, nothing is saved.
Last checked on : we played Classic vs AI and 2 Players in Chrome at 1280×800, counted the games and safe replies above with this page's rules code, and ran the site's rule and AI tests (33 of 33 passed).
Sources, read on November 16, 2026: Wikipedia, "Tic-tac-toe" (the name noughts and crosses and its first print use in 1858, OXO in 1952, a draw with best play, no agreed rule for who plays first); Wiktionary, "cat's game".
