TIC-TAC-TOE

You (X) 0
Draws 0
AI (O) 0

🎯 Keep Playing

All 13 games →

How to Play Tic-Tac-Toe

Tic-Tac-Toe — also known as Noughts and Crosses in the United Kingdom, Australia, and Pakistan — is one of the oldest and most universally recognised two-player strategy games in the world. The game is played on a three-by-three grid. One player marks squares with an X and the other with an O, taking turns until one player places three of their marks in a horizontal, vertical, or diagonal row, or until all nine squares are filled with no winner — a result called a draw.

Game Rules

On MIA Games, you always play as X and move first. Click or tap any empty square on the board to place your mark. In vs AI mode, the computer responds immediately with its move. In 2 Players mode, two people take turns on the same device. The game ends when:

  • A player fills three squares in a horizontal row (top, middle, or bottom)
  • A player fills three squares in a vertical column (left, centre, or right)
  • A player fills three squares diagonally (top-left to bottom-right, or top-right to bottom-left)
  • All nine squares are filled with no three-in-a-row — this is a draw

Press Restart at any time to reset the board while keeping your score. Scores persist across sessions using your browser's localStorage — they will still be there when you return.

AI Difficulty Levels Explained

MIA Games offers three AI difficulty settings, each using a different decision-making strategy:

Easy mode makes the AI play randomly. It picks any available square with no strategy whatsoever. This is ideal for young players or complete beginners who want to learn the game without being overwhelmed. You should win most rounds on Easy.

Medium mode gives the AI partial intelligence. It will take a winning move if one is available, and it will block an obvious player threat — but it does not plan more than one move ahead. With good strategy, an experienced player can consistently beat the Medium AI by setting up two simultaneous winning threats (a fork).

Hard mode uses the Minimax algorithm, a decision-tree search technique used in classical game theory and artificial intelligence. Minimax evaluates every possible sequence of moves from the current board state and selects the move that minimises your best possible outcome while maximising the AI's. In mathematical terms, Tic-Tac-Toe on Hard is a solved game — a perfect Hard AI will never lose. The best result you can achieve is a draw, and only by playing perfectly yourself.

Winning Strategy Tips

Against Easy and Medium AI, these strategies will significantly improve your win rate:

  • Take the centre square first. The centre (position 5) is involved in four of the eight possible winning lines — more than any other square. Claiming it early gives you the most flexibility.
  • Play corners over edges. Corner squares are involved in three winning lines each, while edge squares (top, bottom, left, right midpoints) are involved in only two. Corners give you more attacking options.
  • Create a fork. A fork is a position where you have two simultaneous winning threats. Your opponent can only block one, guaranteeing your win. Setting up a fork usually takes three moves and requires placing your marks in non-adjacent corners.
  • Block immediately. If your opponent has two marks in a row with the third square empty, block that square on your next turn. Even on Medium difficulty, failure to block is the most common reason players lose.

A Brief History of Tic-Tac-Toe

The origins of Tic-Tac-Toe trace back to ancient Rome, where a similar game called Terni Lapilli was played around the 1st century BC. Evidence of the game has been found scratched into Roman tiles and stone. The modern English name "Tic-Tac-Toe" appeared in the United States in the 20th century, while "Noughts and Crosses" became established in the United Kingdom. The game became one of the first ever programmed on an electronic computer — OXO, written by Alexander Douglas in 1952 for his PhD thesis at Cambridge University, is widely considered the first graphical computer game in history.

A Real Run on Our Own Tic-Tac-Toe

We played three full games on the live site, one on each difficulty, all as X moving first. The game opened on Hard, so Easy and Medium were picked from the difficulty selector before those games started. The scores began at 0, and the status read "Your turn — place an X".

The Easy game was over in three moves. X took the centre, the AI answered with a square at the bottom of the board, X took the top-left corner, the AI played the middle of the right edge, and X took the bottom-right corner to complete the diagonal from top-left to bottom-right. The AI never tried to block it. A line was drawn across the three winning squares, confetti fell, and the screen said "You Win!" with the message "Amazing! You beat the AI!" The score showed 1, with 1 win and a streak of 1. Easy plays at random, and this game showed it.

The Medium game was a lesson in blocking. X again took the centre, and the AI took the top-right corner. X took the top-left corner, and this time the AI blocked the diagonal by taking the bottom-right corner. X then took the bottom-left corner, and the AI finished the game down the right column, top-right to bottom-right, for the win. The screen said "AI Wins!" with the message "Better luck next time! Keep practicing." The win streak went back to 0. Medium does what the page promises: it takes a win when it sees one and blocks an obvious threat. The mistake was the third X move, which left the right column free for the AI to complete.

The Hard game ended in a draw, which is the best result the page promises against Hard. X took the centre, the AI took the top-left corner, X took the bottom-right corner, and the AI took the top-right corner, threatening the top row. X blocked the top-middle square, the AI blocked the centre column, X blocked the left column, and the AI blocked the middle row. The last empty square went to X at the bottom-left, the board filled up, and there was no winner. The final board read O, X, O on the top row, X, X, O in the middle, and X, O, X on the bottom. The screen said "It's a Draw!" with the message "Great game! You both played well." No line was drawn, which is right for a draw. The Hard AI blocked every threat, and never lost.

The small details all behaved as the page describes. The AI answered at once after every move, with no waiting. The winning line was drawn across the three winning squares in both games that had a winner. The game-over screen appeared after a short pause, not instantly. The scores were kept across all three games, ending at 1 win, 1 loss and 1 draw. Restart starts a fresh board and keeps the score.

Three lessons stood out. First, take the centre first. It is part of four winning lines, more than any other square, and every game in this run started there. Second, play corners over edges, and block at once when the other side has two in a row. Third, know what each level is for. Easy is for learning the game, Medium is for practising blocking and forks, and Hard is for testing whether you can hold a draw. On Hard, a draw is a result to be pleased with.