Tic-Tac-Toe (Noughts and Crosses)

Take turns drawing O and X on a 3×3 grid. The first to get three in a row across, down or diagonally wins. You can also play on a 4×4 board, or in Vanishing mode, where each player can keep only three marks.

Choose your settings and press Start

Opponent
CPU level
Your mark (O goes first)
Rules

Custom rules
Board size
Old marks vanish

With “Yes”, each player can have only three marks on the board (four on 4×4). Place one more and your oldest mark disappears.

Undo (take back a move)
Report a bug

Only the site operators can read your report. It will not appear in public comments.

Do not include your name, school, address, contact details, or links. The game version and browser type are attached automatically. Privacy

ver 1.0.0 · Updated

Release notes
  1. · ver 1.0.0Added the version label and release notes.
  2. Added the English version.
  3. First published.

How to play tic-tac-toe

Tic-tac-toe is the pencil-and-paper game almost everyone learns as a child. In Britain, Australia and much of the Commonwealth it is called noughts and crosses, and in Canada and Ireland you may hear Xs and Os. Whatever you call it, the game is the same: two players, a grid of nine squares, and a race to be the first to get three marks in a line. A game takes about a minute, which makes it perfect for a quick break, but there is more to it than it seems. Once you know the handful of ideas below, you will never lose a game again, and you will start to see how to set traps for an opponent who doesn’t know them.

Take turns placing X and O

A 3×3 grid with O and X placed alternately, numbered 1 to 4 in the order they were played. An empty square has a blue dotted outline
Starting with O, players take turns marking one empty square at a time (numbers show the order).

Draw two vertical and two horizontal lines to make a 3×3 grid. One player uses O and the other uses X. You take turns writing your mark in any empty square, one mark per turn. Once a mark is on the board it stays there: you can’t move it or erase it. There is no official rule about who starts. Many people in the United States let X go first, while others toss a coin. In this game O always goes first. When you play against the computer you can choose to be O (first), X (second) or take turns, so that each of you starts every other game.

Get three in a row to win

Three Os in a diagonal line, joined by a line through them
Three of your marks in a row, column or diagonal wins the game.

The first player to line up three of their own marks wins. The line can go across (a row), down (a column) or corner to corner (a diagonal). That gives exactly eight possible winning lines: three rows, three columns and two diagonals. Traditionally the winner draws a line through the three marks, and the game does the same for you. If the ninth and last mark completes a line, it still counts as a win, not a draw.

A full board is a draw (a “cat’s game”)

All nine squares filled with O and X, with no three in a row for either player
If all nine squares are filled and nobody has three in a row, the game is a draw.

If every square is filled and neither player has three in a row, the game is a draw, often called a cat’s game or a tie. Draws are very common. In fact, tic-tac-toe is a solved game: if both players make no mistakes, every game ends in a draw. That is why good players spend less time hunting for a “winning trick” and more time steering the game toward positions where the other player is likely to slip.

Tic-tac-toe rules: classic, 4×4 and Vanishing

Besides the classic game, you can pick two other ways to play. With “Custom” you can also mix the board size with the vanishing rule.

ModeBoard and goalDraw
Classic3×3, three in a rowAll 9 squares filled
4×44×4, four in a rowAll 16 squares filled
Vanishing3×3, three in a row, 3 marks eachNo winner after 60 moves
A 4×4 grid where four Os in a row are joined by a line. X has three in a row, which does not win
On the 4×4 board you need four in a row. Three in a row doesn’t count.

4×4 tic-tac-toe uses a grid of 16 squares, and you need four marks in a straight line to win. There are ten lines: four rows, four columns and the two long diagonals from corner to corner. Because every line needs four marks, blocking is much easier than on the small board, and most games between careful players end in a draw. The only way to win is to create two lines that each need one more mark at the same time.

A board with three Os and three Xs. The oldest O is faded and labeled Next to vanish. An empty square is labeled 4th mark
In Vanishing Tic-Tac-Toe, placing a fourth mark removes your oldest one (shown faded).

Vanishing Tic-Tac-Toe is a popular modern twist, sometimes shared online under other names. Each player may have only three marks on the board. When you place your fourth mark, your oldest mark (the first one you still have on the board) disappears. The game shows that mark faded so you always know which one is next to go. A line that uses the faded mark does not count, because the mark is gone before the line is checked. Since the board never fills up, the game rarely ends in a draw; to stop it from running forever, it is called a draw after 60 moves in total (80 moves on a 4×4 board with vanishing marks). It has an ancestor in ancient Rome, where a game called terni lapilli gave each player only three pebbles that were moved around the board.

How to never lose at tic-tac-toe

You only need a few ideas to play perfect tic-tac-toe. Follow these and even the Hard computer can do no better than a draw against you.

1. Win if you can, block if you must

At the start of every turn, check two things in this order. First: do you have two in a line with the third square empty? If so, play there and win. Second: does your opponent have two in a line with the third square empty? If so, block it right now. It sounds obvious, but almost every game lost by a beginner is lost by skipping this check. Make it a habit and you will stop losing to simple threats.

2. The fork: two threats at once

O in a corner, the center and another corner. Two squares have green dotted outlines; O wins by playing either one
A fork makes two lines that each need one more mark. Your opponent can block only one.

Almost every win in tic-tac-toe comes from a fork: a single move that creates two different lines, each with two of your marks and an empty third square. Your opponent can block only one of them, so you complete the other on your next turn. Learning to see forks coming is the heart of tic-tac-toe strategy. When you attack, look for a move that creates a fork. When you defend, look for the square where your opponent could create one and take it first, or force them to answer a threat of your own.

3. The best first move: corner or center

Every first move leads to a draw with perfect play, but some give your opponent more chances to go wrong. Opening in a corner is the strongest practical choice: the only safe reply is the center, and any other answer lets the first player force a win. Opening in the center is also strong: the second player must answer in a corner, and an edge reply loses. An opening on an edge (the middle of a side) is the easiest one to defend against, so it wins fewer games.

4. How to respond as the second player

O in the top-left corner. The center has a green check mark; the other seven squares have red crosses
If the first player takes a corner, answer in the center.
O in the center. The four corners have green check marks; the four edges have red crosses
If the first player takes the center, answer in a corner.

If you go second, your first move decides whether you can hold the draw. Against a corner opening, always take the center. Against a center opening, take a corner. Against an edge opening you have more freedom: the center, a corner next to the first mark, or the edge directly opposite all hold the draw.

Watch out for one classic trap. The first player takes a corner, you correctly take the center, and then they take the opposite corner. It feels natural to grab another corner here, but that loses: the first player blocks and ends up with a fork. The right answer is an edge square. It makes a threat of your own, forces them to block, and the game heads safely to a draw.

5. Make threats that force the reply you want

When you put two marks in a line, your opponent has to block. Strong players use this to “steer” the game: they make a threat whose blocking square is harmless for them, and their next move then creates a fork. Before making a threat, ask yourself where your opponent will have to play and whether that block gives them a threat of their own. Against the Hard level, try playing from the corners and using forced blocks to set up a fork.

Why does perfect play always end in a draw?

On a 3×3 board there are only eight lines, and any single line can be blocked with one move. To win, a player needs a fork, and a fork needs a specific pattern of marks. If the second player answers the opening correctly and blocks every two-in-a-row, the first player can never build that pattern; the same defense works the other way. With both sides defending correctly the board fills up without a winner. Computers have checked every possible game, and the result is always the same. So the real game is not about finding a secret winning move, but about spotting when your opponent has made a mistake.

Tic-tac-toe FAQ

Who goes first, X or O?

There is no single official rule. Many people let X go first, others let the winner or loser of the last game choose, and some flip a coin. The first player has the advantage because they get more chances to make a fork. In this game O always moves first; choose “Take turns each game” to share the advantage fairly.

Can you always win at tic-tac-toe?

No. Against an opponent who makes no mistakes the best you can do is a draw, whether you go first or second. What you can do is never lose, and win whenever the other player makes a mistake, which beginners do often.

Which computer level should I choose?

Start with Easy. It sometimes misses your two-in-a-row or doesn’t notice when it could win, so you can beat it even before you know about forks. Normal blocks most threats but often walks into forks. Hard rarely makes a mistake and is very good at holding a draw, though it still slips now and then, so set up corner attacks and watch for a chance. In Vanishing mode the Hard level plans around marks disappearing and plays aggressively.

Is 4×4 tic-tac-toe a win for anyone?

No. Four in a row on a 4×4 board is a draw with perfect play, and in practice it is even drawier than the classic game. To win you need two open lines of three at the same moment, which usually only happens when your opponent stops paying attention.

Is there a winning strategy in Vanishing Tic-Tac-Toe?

With the rules used here (three marks each, the oldest vanishes, a draw after 60 moves), a complete computer search shows that the first player can force a win by opening on an edge square and playing perfectly. Corner and center openings lead to endless back-and-forth if the second player defends well. It is the opposite of the classic game, where the center is so strong. The winning line is long and hard to find, so in real games the key is simply to keep an eye on which mark will vanish next, both yours and your opponent’s.

Can I undo a move or get a hint?

Yes. With Undo turned on in the settings, the Undo button takes back your last move (and the computer’s reply). Hint marks the best square with a blue dotted outline. The result shows how many times you used each.

Can two people play on one device?

Yes. Choose “A friend” as the opponent and pass the phone, tablet or mouse back and forth. Player O moves first, the bar at the top shows whose turn it is, and the name tags above the board keep count of wins and draws while you keep playing.

Is tic-tac-toe the same as noughts and crosses?

Yes. Tic-tac-toe is the American name and noughts and crosses the British one (a nought is a zero, a cross is an X). The rules are identical.

History of tic-tac-toe

Three-in-a-row games are very old. Grids that look like tic-tac-toe boards have been found on roof tiles in ancient Egypt, and in the Roman Empire people played terni lapilli, “three pebbles at a time”, in which each player had only three pieces and had to move them once they were placed. The name noughts and crosses first appeared in print in Britain in 1858, while the American name tic-tac-toe is more recent. In 1952 a version of noughts and crosses was programmed for the EDSAC computer at the University of Cambridge, making it one of the earliest known video games. Today it is still the first strategy game many children learn, and a classic first project for people learning to program.