X O X
2 Players · vs AI · Easy · Medium · Unbeatable

Tic Tac Toe.

Play against an unbeatable AI or challenge a friend. Real minimax intelligence, trash-talk taunts, and streak tracking. Free forever.

✓ Unbeatable AI✓ 2 Player Mode✓ Fun Taunts✓ Streak Tracker✓ No Download

Loading the board…

How to Play

01

Pick your mode

Choose 2 Players for pass-and-play with a friend, or vs AI to challenge the computer at Easy, Medium, or Unbeatable difficulty.

02

Take your turn

Click any empty cell to place your mark. X always goes first. Get 3 in a row - horizontal, vertical, or diagonal - to win.

03

Score & streak

The scoreboard tracks wins across multiple games. Win 2+ in a row to trigger the streak tracker. Hit New Game to play again instantly.

Opening Win Rates

Opening moveWin %Draw %Lose %Verdict
Center first58%28%14%Best opening
Corner first52%35%13%Strong
Edge first29%48%23%Weak
vs Perfect AI0%100%0%Draw is best case

Strategy Guide

Must-do

Take the center (cell 5)

The center is part of 4 winning lines - more than any other cell. Take it on move 1 whenever possible.

Must-do

Take a corner first

Corners appear in 3 winning lines each. A corner opening forces your opponent to take the center or face a fork trap.

Advanced

Create a fork

A fork means you have two ways to win simultaneously. Your opponent can only block one - you win. This is the main winning strategy.

Advanced

Block opponent's fork

If your opponent is setting up a fork, either block it directly or create your own threat that forces them to defend instead.

Avoid

Avoid edge-only openings

Taking only edges (non-corner border cells) gives you fewer winning line options and is the weakest opening position.

Must-do

Complete your 3-in-a-row

This sounds obvious but beginners often miss it - always scan for an immediate win before making any other move.

The Game Behind the Game

Tic Tac Toe looks deceptively simple - a 3×3 grid, two players, first to three in a row wins. But beneath that simplicity lies a perfectly solved mathematical system, a classic computer science problem, and the same game tree logic that powers modern chess engines and AI systems.

A solved game: Tic Tac Toe is what mathematicians call a "solved game" - the optimal strategy for both players is fully known. With perfect play from both sides, the game always ends in a draw. The only reason wins happen is human error, which is also what makes it fun.

The game's history stretches back further than most people realize. Romans played a version called "Terni Lapilli" around 100 BC, scratched into stone surfaces across the empire. The game arrived in England as "Noughts and Crosses" during the Victorian era, when it became a popular parlour game for children. The name "Tic Tac Toe" became standard in America during the 20th century.

The minimax algorithm

HQCalc's Unbeatable AI uses the minimax algorithm - the same fundamental logic that powers computer chess, checkers, and Go programs. Invented by mathematician John von Neumann in 1928, minimax works by building a complete tree of all possible future game states and choosing the move that maximizes the AI's score while minimizing yours.

For Tic Tac Toe, the game tree has at most 9 levels deep and 9! (362,880) leaf nodes. This is small enough that the algorithm can explore the entire tree in milliseconds, guaranteeing perfect play every time. Larger games like Chess have game trees so vast (roughly 10^120 possible games) that even modern computers can't fully explore them - which is why chess AI uses approximation instead of perfect minimax.

Why Tic Tac Toe is actually deep

Despite being "solved," Tic Tac Toe teaches important thinking skills. The concept of a "fork" - creating two threats simultaneously - is the same logic behind advanced chess tactics, negotiation strategy, and business competitive moves. The ability to think two moves ahead, anticipate your opponent, and set traps rather than react is a transferable cognitive skill.

For children, Tic Tac Toe is one of the best introductory strategy games. It's simple enough that a 4-year-old can understand the rules, but deep enough that a 10-year-old can still improve. The game introduces spatial reasoning, forward planning, and the concept that sometimes defense is the best offense - all within a 30-second game.

How to draw against the Unbeatable AI

You can't win against perfect minimax play - but you can always draw. Here's the guaranteed draw sequence: (1) Take the center. (2) If AI takes a corner, take the opposite corner. (3) If AI takes an edge, take any corner. (4) From here, play defensively - block every threat immediately. With this approach, you'll draw every single game, no matter the difficulty.

More Free Tools

More ways to play and plan

Tic Tac Toe FAQ Hub

Strategy, AI, history, and everything in between.

1. Can I beat the Unbeatable AI in Tic Tac Toe?

No - the Unbeatable AI uses the minimax algorithm which plays perfectly. Against perfect play, the best outcome you can achieve is a draw. If you play perfectly too (center → corner → block), you'll draw every time. The only way to 'beat' it is if you catch a bug, which shouldn't happen.

2. What is the best first move in Tic Tac Toe?

The center square (position 5) is the strongest opening - it's part of 4 of the 8 possible winning lines. Corners are the second-best choice, each belonging to 3 winning lines. Edge squares (non-corner border cells) are the weakest opening with only 2 winning lines each.

3. What is the minimax algorithm?

Minimax is a decision-making algorithm used in game theory. For Tic Tac Toe, it simulates every possible future game state, assigns a score (+10 for AI win, -10 for player win, 0 for draw), and always picks the move that maximizes the AI's score while assuming the human plays optimally. It guarantees perfect play.

4. How do you always win at Tic Tac Toe?

Against a non-perfect opponent: (1) Take the center on your first move. (2) If opponent takes a corner, take the opposite corner. (3) Create a 'fork' - two simultaneous threats so your opponent can only block one. The fork is the winning pattern that guarantees victory against most human players.

5. Can Tic Tac Toe always end in a draw?

Yes - with perfect play from both sides, Tic Tac Toe always ends in a draw. This is why mathematicians call it a 'solved game.' The game is only interesting because most human players don't play perfectly, which is what creates wins and losses.

6. What is a fork in Tic Tac Toe?

A fork is when you create two simultaneous winning threats in one move. Your opponent can only block one threat per turn, so you win by completing the other. Setting up a fork is the primary advanced strategy and is the most common reason skilled players win against beginners.

7. How many possible Tic Tac Toe games are there?

There are 255,168 possible Tic Tac Toe games if you count all sequences of moves. When you remove symmetrically equivalent games (rotations and reflections), there are 26,830 unique games. Of these, 131,184 are won by X, 77,904 by O, and 46,080 are draws.

8. Who invented Tic Tac Toe?

The earliest known version is 'Terni Lapilli' from ancient Rome, around 100 BC. In England, the modern pencil-and-paper version became popular in the Victorian era under the name 'Noughts and Crosses.' The name 'Tic Tac Toe' became the standard term in the United States in the 20th century.

9. What is the difference between Easy, Medium, and Unbeatable AI?

Easy AI makes completely random moves - pure chance, easy to beat. Medium AI plays the minimax-optimal move 65% of the time and a random move 35% of the time - beatable but unpredictable. Unbeatable AI always plays the minimax-perfect move with no randomness - it cannot be beaten, only drawn.

10. Is Tic Tac Toe good for kids?

Yes - Tic Tac Toe is excellent for children. It develops spatial reasoning, forward planning, and pattern recognition. It's simple enough for ages 4+ but has enough strategic depth that older children can develop genuine skill. Playing against the AI introduces children to the concept of game trees and logical thinking.

11. What is the correct name - Tic Tac Toe or Noughts and Crosses?

'Tic Tac Toe' is the standard name in the United States, India, and most of Asia. 'Noughts and Crosses' is the traditional British name. 'Xs and Os' is commonly used in Ireland and South Africa. They are all the same game.

12. Can the second player (O) ever win in perfect play?

No. In perfectly played Tic Tac Toe, the second player (O) can only achieve a draw at best, never a win. O's optimal strategy is purely defensive - blocking X's threats and preventing X from winning, with no opportunity to force a win of their own.

13. How does the streak tracker work?

The streak tracker counts consecutive wins by the same player across multiple games. When one player wins 2 games in a row, it shows 'Getting hot!' At 3+ consecutive wins, it shows 'UNSTOPPABLE!' The streak resets on any draw or when a different player wins.

14. Is this Tic Tac Toe game free?

Yes, 100% free with no sign-up, no ads, no in-app purchases, and no download. Play directly in your browser on any device.

15. Can I play Tic Tac Toe on mobile?

Yes - HQCalc's Tic Tac Toe is fully responsive and touch-optimized. The cells are large enough for comfortable tap targets on any smartphone. Works on iOS Safari, Chrome for Android, and all modern mobile browsers.

16. How does the fun mode work?

The fun mode isn't a separate mode - the taunts and commentary are always active! After every move, a witty comment appears. After a win, a victory taunt appears. Draws get their own special commentary. When the AI wins, it trash-talks. When you beat the AI, you get a legendary message.

17. What is the 2-player mode?

2-player mode is pass-and-play on the same device. Player X makes a move, then hands the device to Player O. The scoreboard tracks wins across multiple games. Perfect for playing with a friend or family member on a single phone or tablet.

18. Why is corner vs edge opening so different in win rate?

Corner squares appear in 3 winning lines (horizontal, vertical, and one diagonal). Edge squares appear in only 2 winning lines (one horizontal/vertical and no diagonals). More winning lines means more paths to victory and more forking opportunities. This makes corner openings statistically 2× stronger than edge openings.

19. Does the first player always have an advantage?

Yes - the first player (X) has a statistical advantage in non-perfect play. X gets 5 moves to O's 4, has more winning opportunities, and can force more forking patterns. In tournaments and research studies, X wins more often than O when both players make small mistakes, even though perfect play always draws.

20. What math concepts does Tic Tac Toe teach?

Tic Tac Toe is a gateway to several mathematical concepts: game theory (optimal strategy), combinatorics (counting game states), symmetry groups (equivalent board positions), graph theory (game trees), and algorithmic thinking (minimax decision trees). It's used in computer science education to introduce AI and search algorithms.

HQcalc • Tic Tac Toe Online

Developed by Shivam Sagar. Unbeatable AI powered by the minimax algorithm. 100% browser-based, no data stored. © 2026.