Play tic tac toe online
Tic tac toe – get three in a row to win: tap a square or use your keyboard. Play the computer at three levels or a friend on the same device – the score is kept for you.
Source: Wikipedia: Tic-tac-toe. Updated: .
How it is calculated
How to play tic tac toe
Tic tac toe (also called noughts and crosses or Xs and Os) is played on a 3 × 3 grid. Two players take turns placing their mark, X or O. The first to get three marks in a row – across, down or diagonally – wins. If all nine squares are filled without a line, the round is a draw.
- Choose a mode: “vs computer” (you play X) or “2 players” on one phone, tablet or computer.
- Who starts: you, the computer, or take turns – with “Take turns” the other side opens every new round.
- Pick a square: tap or click it; on a keyboard use the arrow keys and Enter, or press 1–9.
The three computer levels
- Easy: the computer plays a random empty square – good for kids and warming up.
- Medium: it wins when it can and blocks your open two-in-a-row, otherwise it plays randomly. A fork (two threats at once) beats it.
- Unbeatable: the computer uses the minimax algorithm to search every possible continuation to the end and always picks a best move. The best you can get is a draw.
Why does perfect play always end in a draw?
Tic tac toe is a solved game: if both sides play without mistakes, nobody wins. There are only 765 essentially different positions, so a computer can check them all in a split second – which makes the game a classic first example of game AI.
Tips to win more often
- Open in a corner. If your opponent does not answer in the centre, you can force a fork.
- If they do take the centre, play the opposite corner – weaker players often go wrong here.
- Playing second against a corner opening, always take the centre, or you will lose.
Bigger boards: 4 × 4 and 5 × 5
Under “Board” you choose 3 × 3, 4 × 4 or 5 × 5. On 4 × 4 you need four in a row, and on 5 × 5 four as well – across, down or diagonally; the rule is shown below the board. On the bigger boards the top level is called “Hard”: the computer looks several moves ahead there, but it is not provably unbeatable the way it is on 3 × 3. The winning row is struck through with a line.
Play tic tac toe with a friend by link
Choose “Friend via link”, make your move and send the link by messenger or email. Your friend opens it, sees the position, plays a move and sends their link back – and so on, turn by turn, to the end. The moves are stored only in the link (after the #); there is no account and no server keeping the game. These games do not count towards the score.
Score and privacy
Wins, losses and draws are counted separately for “vs computer” and “2 players” and stored in your browser’s localStorage. Nothing is sent to a server. The computer’s random choices come from the browser’s cryptographic random number generator.
More games: Hangman, flip a coin or the score keeper for game night.
Frequently asked questions
Can you beat the unbeatable level?
No. It searches every possible game and always plays a best move. With perfect play you can reach a draw – that is the best anyone can do against perfect tic tac toe.
How do I beat the medium level?
Set up a fork: start in a corner and create two open lines of two at the same time. The computer can only block one of them.
Can two people play on one device?
Yes. Choose “2 players” – X and O take turns on the same phone, tablet or computer. The score for this mode is kept separately.
Who starts with “Take turns”?
The side that did not start the previous round. The very first round starts with X.
How do I play with the keyboard?
Arrow keys move the selection and Enter or Space places your mark. Faster: press 1–9, where 1 is top left and 9 bottom right. When a round is over, Enter starts a new one.
Is my score saved?
Yes, only in your browser (localStorage). It survives a page reload; “Reset score” sets it back to 0.
How many possible games of tic tac toe are there?
There are 255,168 possible games, but only 765 essentially different positions once rotations and reflections are merged.
Sources and legal basis
As of: · Editorial policy
Related tools
- Play hangman onlineFree hangman game in your browser: 3,000 common English words in three levels, a word of the day, or send your own secret word to a friend as a link.
- Flip a coin: heads or tails?Flip a coin online: heads or tails, 1 to 1,000 flips per toss, your own labels for both sides, live stats and streaks. Cryptographic randomness, no sign-up.
- Dice roller: roll d6, d20 and more onlineDice roller: roll d4 to d100 or type dice notation like 3d6+2 or 2d20kh1. Several sets at once, advantage, roll history, exact odds and a shareable link.
- Online score keeperFree online score keeper and score counter for board and card games: rounds, running totals, rankings, target score and undo. Saved locally in your browser.
- Play Solitaire OnlineFree Klondike solitaire in your browser: draw 1 or 3, unlimited undo, hints and a winnable daily deal. Share your time – the link deals the same cards.
- Bocce scoreboard and score keeperBocce scoreboard online: after each frame tap the scoring team and its points; the score is shown large and the board calls the winner at your target.
- Writing prompts at randomWriting prompts at random: spin for one of 75 ideas – stories for kids and middle school, creative prompts for adults, journal and opinion prompts. Add yours.
- Workout wheel: spin your trainingWorkout wheel with 12 no-equipment exercises like push-ups, plank and squats, 8.33% chance each. With how-tos, beginner options and a routine.
- Never have I ever questions generatorNever have I ever questions at random: spin for one of 90 clean statements for friends, kids, teens, work, couples and travel. Played with fingers, not drinks.