Tic Tac Toe – Play Online Free

Tic Tac Toe is a two-player game in which X and O take turns marking a 3×3 grid, and the first player to get three marks in a row, across, down or diagonally, wins. Play it free on Play5s on eight boards, from classic 3×3 to Vanishing, 4×4 to 7×7, a 100×100 Giant board and Ultimate, against the computer on Easy, Medium or Hard or with a friend on one device, with a ranked Daily Gauntlet, on any phone, tablet or computer, with no download and no account.

Players
1–2
Boards
8, from 3×3 to 100×100
Modes
Free play, Gauntlet, Daily
Controls
Tap, click or keyboard
Devices
Phone, tablet, computer
Saves your game
Yes, on this device

Quick start

  1. Pick a board and your options on the start screen: computer or 2 players, Easy, Medium or Hard, and X or O.
  2. Tap or click an empty square to draw your mark. X always goes first.
  3. Get three in a row, across, down or corner to corner, to win on the classic 3×3 board; the larger boards ask for 4 or 5.
  4. Use Undo to take a move back, or Hint to see a strong square, in free play.
  5. Want a ranking? Start the Daily Gauntlet: five rounds against the computer, 3 points for a win, 1 for a draw.
On this page

How to play Tic Tac Toe

To win Tic Tac Toe, get three of your marks in a row, across, down or corner to corner, before your opponent does; if all nine squares fill up with no line, the game is a draw.

The rules on the classic 3×3 board

Two players, X and O, take turns marking one empty square of a three-by-three grid. A mark stays where you put it. The grid has 8 winning lines: three rows, three columns and two diagonals. When one is filled with the same mark, that player wins and a crayon line is struck through it.

If the board is full and nobody has a line, the game is a draw, which players also call a cat’s game. With best play from both sides every game of 3×3 Tic Tac Toe ends in a draw, so you win only when your opponent slips.

Tic Tac Toe board on Play5s with a red X diagonal struck through in crayon after a winZoom in
A finished Classic game: X filled the long diagonal and the winning line is drawn through it.

Who moves first, and playing as O

The rules do not say who starts. On Play5s, X always moves first, by the usual convention. Against the computer you choose X or O on the start screen; if you pick O, the computer opens with its first X and you answer.

Two people can also share one device: pick 2 players and the status line above the board says whose turn it is. The game cannot connect you to someone on another device.

Eight boards: Classic, Vanishing, 4×4 to 7×7, Giant and Ultimate

Play5s has eight boards, each a different version of the same idea, from the 3×3 classic to a 100×100 Giant board and nine boards in one.

Pick any of them from the start screen or the board button in the top bar. The rules of each one are below.

The eight boards, what wins and what is special about each
BoardSizeTo winWhat is special
Classic3×33 in a rowA draw is possible; perfect play always draws
Vanishing3×33 in a rowEach side keeps 3 marks; the oldest vanishes; no draws
4×44×4A full line of 410 lines: 4 rows, 4 columns, 2 diagonals
5×55×54 in a rowA line of 5 also wins
6×66×64 in a row36 squares
7×77×74 in a row49 squares
Giant100×1005 or more in a rowDrag to pan, zoom, overview map
Ultimate9 boards of 3×33 small boards in a rowYour square sends your opponent to a board
Tic Tac Toe start screen on Play5s with eight board choices and computer level optionsZoom in
The start screen: eight boards, Easy, Medium or Hard, X or O, and the ranked Gauntlet.

Vanishing: each side keeps only three marks

On the Vanishing board you keep at most three marks. When you place a fourth, your oldest mark disappears at once; only your own marks vanish. A square whose mark is about to vanish is still taken until the move is made, and marks that vanish with your move do not count towards a line.

The board never fills up, so there are no draws; a game lasts until someone makes three in a row. The faded mark shows which of your marks goes next. We searched every position of this version with the rules code on this page, 116,074 positions in all, and the first player can force a win with perfect play, within the first player’s seventh mark. The same rules appear as “Lite 3” in the GamesCrafters project at UC Berkeley (see Lite 3 (opens in a new tab)).

Vanishing Tic Tac Toe board with the oldest X drawn faded and dashed before it disappearsZoom in
Vanishing mode: the oldest X is drawn faded, because it vanishes with X’s next move.

4×4, 5×5, 6×6 and 7×7: longer lines on bigger grids

On 4×4 you must fill a whole row, column or long diagonal: four in a line, with three winning nothing. On 5×5, 6×6 and 7×7 four in a row is enough, and a line of five also wins. A move that joins two groups can make five at once.

Mathematicians call these “m,n,k-games”: m by n squares, k in a row, so classic Tic Tac Toe is the 3,3,3-game. By computer search, 4×4 with four in a row is a draw with perfect play, and so is 5×5 with four in a row, while a 6-by-5 board is already a win for the player who starts (see m,n,k-game (opens in a new tab) on Wikipedia).

Giant: five in a row on 100×100

The Giant board has 10,000 squares and needs five or more in a row; six in a row counts, and the ends of the line do not matter. It is far bigger than any screen, so you drag the board to move around, use + and − to zoom, press Last move to jump back, and watch the small map that shows every mark and the part you are looking at.

Giant 100 by 100 Tic Tac Toe board with zoom buttons and an overview map of all marksZoom in
The Giant board with its zoom buttons and the overview map, drawn from a real game in progress.

Ultimate: nine boards in one

In Ultimate Tic Tac Toe nine small 3×3 boards sit inside one big 3×3 board, 81 squares in all. The first move can go anywhere. After that, the square you mark decides which small board your opponent must play in: mark the top-right square of any small board and your opponent plays in the top-right board.

Three in a row inside a small board wins that board, and a big X or O is drawn over it. A small board that fills up with no line counts for nobody. If you are sent to a board that is already won or full, you may play in any open board, as Wikipedia describes. Three won boards in a row win the game, and if every board closes with no such line, it is a draw. The board you must use is lit up, and the status line names it.

Ultimate Tic Tac Toe with nine small boards and the board the next player must use highlightedZoom in
Ultimate Tic Tac Toe: the lit board is the only one the next player may use.

Easy, Medium and Hard: how the computer plays

The computer has three levels: Easy makes mostly random moves, Medium wins and blocks when it can, and Hard looks ahead and, on the classic 3×3 board, cannot lose.

Hard on the classic board never loses, because it searches the whole game. We tested it with every possible sequence of human moves, as X and as O, against 20 different random tie-breaks of the computer: 13,423 games, and the person won none of them. The same search powers the Hint button in free play.

On 4×4 to 7×7, Vanishing and Ultimate, Hard searches within a fixed number of positions per move, not a clock, so it plays the same on a slow phone and a fast computer. The computer answers after a short pause so you can see its move being drawn.

How each level picks its square
LevelHow it picks a squareCan you beat it?
EasyA random empty square; sometimes it takes a win it seesYes, easily
MediumTakes a winning square, then blocks yours. On 3×3 to 7×7 it then picks among its three best-scored squares; on Vanishing it likes the centre, otherwise a random squareYes; it does not see a fork coming
Hard (3×3)Searches every possible continuation to the end of the game and picks a best move, at random among equal onesNo: a draw is the best you can do
Hard (4×4 to 7×7, Vanishing)Takes wins, blocks, then searches ahead as far as a fixed number of positions per move allowsYes, with good play
Ultimate and GiantUltimate: Medium wins a small board when it can without sending you to a board you can win at once; Hard also searches ahead within a fixed number of positions. Giant: both score every square near the marks and take or block fives; Medium picks among the best three, Hard also weighs your best replyYes, with good play

Undo, New game and your record

Undo takes back your last move; against the computer it also removes the computer’s reply, so it is your turn again, and with 2 players it takes back one move at a time. Once a game is over, Undo is off. New starts the next game, asking first if one is in progress.

The W·D·L box shows your wins, draws and losses for the board and level you are playing; with 2 players it counts X wins, draws and O wins. It lives in this browser only.

The Daily Gauntlet and leaderboards

The Gauntlet is the ranked mode: five rounds against the computer, each on a different board and each tougher than the last, scored 3 points for a win and 1 for a draw, and a loss ends the run.

How a Gauntlet run works

Every run uses five different boards out of Vanishing, 4×4, 5×5, 6×6 and Ultimate, in an order the seed chooses, and the computer plays Easy in round 1, Medium in rounds 2 and 3, and Hard in rounds 4 and 5. The seed also decides who moves first in each round. There is no Undo and no Hint in the Gauntlet.

The computer in the Gauntlet searches with a smaller budget than Hard in free play, because our server replays every move of a ranked run to check it. The run is over after a loss or after round five, and the screen shows your points, wins, draws and losses.

Daily Gauntlet, ranking and server time

The Daily Gauntlet gives everyone the same five rounds. The day changes at midnight New York time, and because our server hands out the day’s seed, the Daily Gauntlet needs an internet connection. Each connection gets one ranked Daily Gauntlet result per day; playing it again after that is practice.

A finished run goes on a leaderboard when it scored at least one point. It is ranked by points, and a tie goes to the faster run, then to whoever submitted first. The time is measured by our server from the moment the run starts. Pick a nickname of 2 to 12 characters (offensive names are refused; no account is needed) and you can submit it; there is a Daily board and an all-time board.

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, so you win by setting up a position where your opponent can go wrong.

What every move should check

A player who follows this order of priorities, as in Newell and Simon’s 1972 program, never loses on 3×3 (see Tic-tac-toe (opens in a new tab) on Wikipedia):

  • Win: with two in a row and the third square empty, play it.
  • Block: if your opponent has two in a row, take the third square yourself.
  • Fork: make a move that creates two lines that each need one more mark; your opponent can block only one.
  • Block their fork: stop your opponent’s fork, or force them to answer a threat.
  • Centre, then opposite corner, then an empty corner, then an empty side.

Opening moves and the numbers behind them

Every one of the nine first moves draws with perfect play, but they differ in how easily the other player goes wrong.

The centre sits on 4 of the 8 lines, each corner on 3 and each edge on 2. After a corner opening the centre is the only reply that does not lose, which is why a corner is a good first move against a weaker opponent; after a centre opening any corner reply is safe and an edge reply loses; after an edge opening four replies are safe, the centre, the two corners beside that edge and the edge across from it. We checked all of this with a full search of the 3×3 game.

We counted every possible game on the classic board, from the empty board until someone wins or the board fills, with X moving first, using the rules code on this page: there are 255,168 games. X wins 131,184, O wins 77,904 and 46,080 end in a draw. Up to rotations and reflections there are 138 finished positions.

Winning lines through each square of the 3×3 board
SquareWinning lines through it
Centre4
Each corner3
Each edge2

Controls: touch, mouse and keyboard

Tap or click an empty square to mark it, or play with the keyboard alone: arrow keys to move and Enter or Space to place a mark.

The top bar shows the Time, your Moves, the W·D·L record (or Gauntlet points) and your Best Gauntlet score. New starts a game, Undo and Hint work in free play, the board button opens the start screen to change boards and options, the trophy opens the leaderboards, Full screen enlarges the board and the gear (Settings) holds the switches for the pencil sounds and optional music.

The game saves itself after each move in your browser, so you can close the page and press Continue later; clearing site data removes the saved game and your record.

  • Arrow keys: move the focus ring across the board
  • Enter or Space: place your mark on the focused square
  • U or Ctrl+Z: undo (free play)
  • H: show a hint (free play)
  • N: new game
  • F: full screen on or off
  • M: sound on or off
  • + and −: zoom the Giant board

History of Tic Tac Toe

Tic Tac Toe is very old: boards for three-in-a-row games have been found on roof tiles from ancient Egypt dated to about 1300 BC.

The Romans played a close cousin around the first century BC, terni lapilli (“three pebbles at a time”), in which each player had only three pieces and had to move them. The English name noughts and crosses first appeared in print in 1858, in *Notes and Queries*, while “tick-tack-toe” appears in 1884 for a different children’s game; the American name “tic-tac-toe” took over in the 20th century.

In 1952, British computer scientist Sandy Douglas wrote OXO, a noughts and crosses program for the EDSAC computer at the University of Cambridge that played perfect games, and it is counted among the first video games. In 1975 MIT students built a computer out of Tinkertoys that plays Tic Tac Toe perfectly (see Tic-tac-toe (opens in a new tab) on Wikipedia).

Tic Tac Toe questions

Can I play Tic Tac Toe online for free?

Yes. Tic Tac Toe on Play5s is free, runs in your browser on a phone, tablet or computer, and needs no download and no account.

Can I play Tic Tac Toe with a friend?

Yes, on one device: choose 2 players on the start screen and take turns on the same screen. The game cannot connect you to a friend on another device.

Can you beat the computer at Tic Tac Toe?

On Easy and Medium, yes. On Hard 3×3 the computer cannot lose: the best you can do is a draw. On the bigger boards Hard can be beaten with good play.

Who goes first in Tic Tac Toe?

The rules do not say. On Play5s X always goes first; against the computer you choose whether to be X or O, and if you pick O the computer opens.

Is Tic Tac Toe a solved game?

Yes. With best play from both sides the classic 3×3 game is always a draw. The Vanishing version is different: by our search of all 116,074 positions, the first player can force a win.

What is a cat’s game?

A cat’s game is a draw: every square is filled and neither player has three in a row.

How many ways are there to win at Tic Tac Toe?

There are 8 winning lines on the 3×3 board: 3 rows, 3 columns and 2 diagonals. Counting every possible game, X wins 131,184 of 255,168, O wins 77,904 and 46,080 are draws.

What is Ultimate Tic Tac Toe?

Nine small boards inside one big board: the square you mark chooses the small board your opponent plays in, you win a small board with three in a row, and three small boards in a row win the game.

What is the Daily Gauntlet?

A ranked run of five rounds against the computer, the same for everyone each day, resetting at midnight New York time. A win scores 3, a draw 1, a loss ends the run, and it needs an internet connection.

How are Tic Tac Toe leaderboards ranked?

By points, then by the faster server-measured time, then by who submitted first. A run must be finished and have scored at least one point to go on a board.

Does the game save my progress?

Yes. Your game in progress, your W·D·L record and your best Gauntlet score are stored in this browser. Clearing browser storage removes them.

About this version

This Tic Tac Toe was built by Play5s to run in any modern web browser. It has eight boards, three computer levels (Hard on 3×3 searches the whole game), 2 players, hand-drawn SVG crayon marks, Web Audio sound effects and a ranked Daily Gauntlet.

There is nothing to install and no account to create. Your game in progress is kept in your browser. Starting a ranked run asks our server for a seed and a ticket; your moves and nickname are sent only when you submit a score.

Read more about Play5s, or see all of our free online board games.

Last updated