Play Tic-Tac-Toe Online

The classic noughts and crosses game. Place your marks and be the first to get three in a row. Challenge the AI or play with a friend.

Pick Your Side (X goes first)
Game Mode
AI Difficulty
X You: 0
vs
O AI: 0
Draws: 0
Your turn
Tic-Tac-Toe classic strategy game — place X's and O's to get three in a row

What Is Tic-Tac-Toe?

Tic-Tac-Toe — also known as Noughts and Crosses, Xs and Os, or simply three in a row — is one of the most well-known and widely played board games in the world. It is a two-player, zero-sum, perfect-information game that has been studied extensively in game theory, computer science, and recreational mathematics.

The game is played on a simple 3×3 grid. Two players take turns placing their mark — traditionally X and O — in any empty cell. The first player to get three of their marks in a row (horizontally, vertically, or diagonally) wins the game. If all nine cells are filled without a winner, the game ends in a draw (also called a “cat’s game”).

Despite its apparent simplicity, Tic-Tac-Toe has a total of 255,168 possible game states (before accounting for symmetry). When played perfectly by both sides, it always results in a draw — making it a classic example of a solved game.

How to Play Tic-Tac-Toe

  1. X goes first. Players take turns, with X always making the opening move. Players alternate between X and O each turn.
  2. Place your mark. On your turn, tap or click any empty cell on the 3×3 grid to place your mark (X or O).
  3. Three in a row wins. The first player to get three of their marks in a straight line — horizontal, vertical, or diagonal — wins the game.
  4. Draw if the board fills up. If all nine cells are occupied and neither player has three in a row, the game ends in a draw.

Tic-Tac-Toe Strategy Guide

1. Take the Centre

The centre cell is the most powerful position on the board. It participates in four of the eight possible winning lines (one horizontal, one vertical, and both diagonals). If you’re X, taking the centre on your first move gives you the most flexibility. If you’re O and the centre is open, claim it immediately.

2. Corners Are Key

After the centre, the corner cells are the next most valuable positions. Each corner participates in three winning lines and creates natural forking opportunities. Opening in a corner (if the centre is taken) or responding to a corner opening with the centre is standard play.

3. Create a Fork

A fork is a position where you have two threats to win simultaneously. Your opponent can only block one, so you win on the next move. The classic example: if you have the centre and two opposite corners, you force a fork that cannot be stopped. Setting up forks is the key to winning against imperfect opponents.

4. Block Your Opponent

Always check if your opponent has two in a row before making your move. If they do, you must block them — otherwise they win on their next turn. Defence comes first, then look for your own offensive moves.

5. Avoid Edge Openings

The four edge cells (top-middle, left-middle, right-middle, bottom-middle) are the weakest positions. Each edge only participates in two winning lines. Opening on an edge gives your opponent more options to build a fork. Prefer the centre or corners whenever possible.

6. The Perfect Strategy for X

As the first player, X has a well-known winning strategy against imperfect play: take the centre, then take the opposite corner from wherever O plays. This sets up a fork that guarantees either a win or a draw. Against perfect play, X can always force a draw.

7. The Perfect Strategy for O

As the second player, O’s best strategy is purely reactive. If X takes the centre, O should take a corner. If X takes a corner, O should take the centre. If X takes an edge, O should take the centre (if available) or a strategic corner. Perfect defence always guarantees O a draw.

About the AI

Our Tic-Tac-Toe features three distinct AI difficulty levels, each designed to provide the right level of challenge:

  • Easy: Makes random moves 70% of the time. It will occasionally stumble into a smart move but mostly plays randomly. Great for beginners and young children learning the game.
  • Medium: Uses basic strategy — blocks two-in-a-row threats, takes winning moves when available, and prefers the centre and corners — but makes deliberate mistakes about 25% of the time. Provides a fun, beatable challenge for casual players.
  • Unbeatable: Uses the minimax algorithm to search the entire game tree and choose the optimal move every time. It plays perfect tic-tac-toe — it will never lose. The best you can achieve against it is a draw. Can you manage even that?

The Mathematics of Tic-Tac-Toe

Tic-Tac-Toe is one of the first games that was completely solved by exhaustive analysis. Here are some fascinating numbers:

  • There are 9! (362,880) possible orderings of moves, but accounting for games that end early, there are exactly 255,168 unique games.
  • After removing symmetries (rotations and reflections), only 26,830 unique games remain.
  • There are 138 winning terminal positions for X and 77 for O (X wins more because X goes first).
  • There are 8 possible winning lines on a 3×3 board: 3 horizontal, 3 vertical, and 2 diagonal.
  • The game was famously featured in the 1983 film WarGames, where a computer learns that “the only winning move is not to play” after simulating every possible game.

History of Tic-Tac-Toe

Tic-Tac-Toe has ancient origins. Precursors of the game have been found in Ancient Egypt (circa 1300 BCE) on roof tiles, and the Roman Empire played a similar game called Terni Lapilli on stone boards scratched into public surfaces. The modern 3×3 pen-and-paper version became widespread in the 19th century.

The name “Tic-Tac-Toe” was first used in the early 20th century in the United States, while “Noughts and Crosses” remains the standard name in the United Kingdom, Ireland, Australia, and New Zealand. The game goes by many other names around the world: Tres en raya (Spanish), Morpion (French), Tris (Italian), and Jogo da Velha (Portuguese).

In 1952, OXO (also called Noughts and Crosses) became one of the first video games ever created when British computer scientist Alexander S. Douglas programmed it on the EDSAC computer for his PhD thesis at the University of Cambridge. Today, Tic-Tac-Toe is often used as a teaching tool for game theory, AI algorithms (especially minimax), and introductory computer programming courses.

Variations of Tic-Tac-Toe

The basic game has inspired many creative variations over the centuries:

  • Super Tic-Tac-Toe (Ultimate): Played on a 3×3 grid of 3×3 boards. Your move determines which sub-board your opponent must play in. Play Super Tic-Tac-Toe here.
  • Order and Chaos: One player tries to get five in a row, the other tries to prevent it, on a 6×6 board. Both players can place either X or O. Play Order & Chaos here.
  • Gomoku: Connect five in a row on a 15×15 (or larger) board. A more complex, strategic cousin. Play Gomoku here.
  • Shift Three: Drop discs into a 3×3 standing grid or shift rows sideways. Combines tic-tac-toe with a dynamic, shifting board. Play Shift Three here.
  • 3D Tic-Tac-Toe: Played on a 4×4×4 cube. Players try to get four in a row in any direction through three-dimensional space.
  • Misère Tic-Tac-Toe: The reverse — the first player to get three in a row loses. Adds a surprising twist to strategy.

Frequently Asked Questions

Tic-Tac-Toe (also known as Noughts and Crosses) is a two-player game on a 3×3 grid. Players take turns placing X or O. The first to get three marks in a horizontal, vertical, or diagonal line wins. If the board fills up with no winner, it’s a draw.
No — with perfect play from both sides, the game always ends in a draw. However, if your opponent makes mistakes, you can exploit them to win. X (first player) has a slight advantage and can force at least a draw with optimal play.
The centre cell is the strongest opening move. It participates in four of the eight winning lines and creates the most forking opportunities. Corners are the second-best choice, as they participate in three winning lines.
The Unbeatable AI uses the minimax algorithm to search every possible future game state and choose the optimal move. It plays mathematically perfect Tic-Tac-Toe and will never lose. The best result you can achieve against it is a draw.
Yes! The game is fully responsive and designed for touch screens. Just tap any empty cell to place your mark. The board scales to fit any device.
A fork is a position where you create two simultaneous threats to win. Your opponent can only block one of them, so you win on the next turn. Setting up forks is the most important offensive strategy in Tic-Tac-Toe.

More Puzzle & Strategy Games

If you enjoy Tic-Tac-Toe, check out these other games on our site: