SuperDevTools

Tic Tac Toe online

Board
Mode

Keyboard: arrow keys to move, Enter or Space to play

Series score
Won
0
Lost
0
Draws
0

Play tic tac toe in your browser

This tic tac toe game (also called noughts and crosses) is played on a 3 by 3 board. Players take turns placing X or O, and the first to get three in a row, column or diagonal wins. Play the computer or a friend on the same device. Nothing is sent anywhere: the game and the score stay with you.

It is a very old game, found in various forms in several early cultures, though its exact origin is unclear.

How to play

  1. Pick the "Board" ("3 × 3" for the classic game) and the "Mode": "Against the computer" or "Two players, one device".
  2. Against the computer, set the "Level" (Easy, Medium, Unbeatable) and your mark in "You play". "Who goes first" offers "X goes first", "O goes first" or "Take turns".
  3. Tap a square to play. With a keyboard, the arrow keys move between squares and Enter or Space places your mark.
  4. The winning line is highlighted and a draw is announced when the board is full. In two-player mode, "Undo move" takes back the last move while the game is on.

The "Series score" (won, lost, draws) stays on your device until you press "Reset score". Changing the board, mode, mark or first player starts a new game.

Basic strategy

Columns are A, B, C from left to right and rows 1, 2, 3 from top to bottom: A1 is the top left corner, B2 the centre.

  • The centre sits on 4 of the 8 winning lines.
  • Corners sit on 3 lines, edge squares on only 2.
  • A fork makes two threats at once, and your opponent can only block one.

Example: X plays C1, O answers B1 (an edge, which is a mistake). X takes B2 and threatens A3, so O has to play A3. X now plays C3 and threatens C2 (column C) and A1 (diagonal C3, B2, A1). O cannot block both, and X wins next move.

Why perfect play ends in a draw

On 3 × 3, every attack has an answer. If X opens in a corner, O must take the centre; if X opens in the centre, O must take a corner. After that, blocking every two in a row is enough. The "Unbeatable" level works the game out to the end before each move, so it never loses.

Variants

4 × 4 (4 in a row): 10 winning lines, and blocking is easier than attacking, so draws are common.

5 in a row: on "5 × 5" you must fill a whole line. On "15 × 15" you play a simplified gomoku with no tournament rules: five in a row wins, and so does six. On these boards the top level is called "Hard": the computer wins when it can, blocks your threats, and otherwise picks the square that best builds its lines and spoils yours. It plays well, but it can be beaten.

Playing with children

Tic tac toe teaches kids to think a move ahead and to lose without a fuss. Start on "Easy": the computer mostly plays at random and sometimes misses a win. Move up to "Medium" once your child wins often, as it then blocks every two in a row. In two-player mode, "Undo move" lets you replay a bad move and talk it through.

Frequently asked questions

Can anyone beat the Unbeatable level?

Not on 3 × 3. The best result you can get against it is a draw.

Where is my score saved?

Only in your browser, on your device. It is lost if you clear the site's data.

Can I undo a move against the computer?

No. "Undo move" only exists in "Two players, one device" mode.

Who starts with "Take turns"?

X starts the first game, O the next, and so on. Going first gives a small edge, so taking turns keeps the series fair.