Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Play Tic Tac Toe Game

Play tic tac toe against the computer in your browser. Make your move, challenge the AI, and restart anytime for quick breaks on mobile.

Enter the Details



Last updated: February 6, 2026

Created by: Eon Tools Dev Team

Reviewed by: Sugam Baskota



What this does

So you fancy a quick game of tic tac toe and there is nobody around to play. The computer will. Pick who goes first, click a square to place your mark, and it plays back against you. It is a fast little game for a two minute break, and fair warning, the computer is good. Very good.

How to use it

  1. Choose who starts, AI starts or Human starts, with the radio buttons at the top.
  2. Click any empty square to place your O. The computer plays X.
  3. Try to get three in a row. Hit Reset to start a fresh game.

You are the O, the computer is the X.

How it works

The board is drawn with a small graphics library called p5.js, which is why it looks like a proper game rather than a plain grid. The clever bit is how the computer chooses its move. It uses a classic method from game theory called minimax. In plain terms, before every move it looks ahead at every possible way the rest of the game could play out, assumes you will play your best, and then picks the move that gives it the best guaranteed result. It does all of that on your device, instantly.

Can you beat it?

Honestly? No. And that is not me being dramatic. Because the computer looks at every possible outcome and never makes a mistake, it cannot lose. Tic tac toe is what mathematicians call a solved game, which means the best result is already known, and if both players play perfectly, it always ends in a draw. So your goal here is not to win, it is to not lose, to play well enough to force that draw.

A few things help. Take the centre if it is free, since it sits on more winning lines than any other square. Watch for the computer setting up two threats at once, called a fork, because you can only block one of them. And block every line where it already has two in a row, straight away. Do all of that without slipping up and you will earn your draw. Slip up once, and it will punish you.

What it is good for

It is a perfect little time filler, a quick game while you wait for something to load or boil. It is also a genuinely good way to sharpen your own tic tac toe, since playing a perfect opponent teaches you the patterns fast. And it is a neat demo if you ever want to show someone what game playing AI looks like at its simplest.

Questions people ask

Can I beat the computer?

No. It plays perfectly and cannot lose. The best result you can get is a draw, and only if you play perfectly yourself.

Why can I never win?

Because tic tac toe is a solved game. With perfect play from both sides it always ends in a draw, and the computer always plays perfectly.

Does it matter who goes first?

It changes how the game flows, but not the outcome against a perfect opponent. Either way, the best you can do is draw.

What is minimax?

It is the method the computer uses to play. It looks ahead at every possible continuation and picks the move with the best guaranteed result, which is what makes it unbeatable.

References

  1. Wikipedia. Minimax. https://en.wikipedia.org/wiki/Minimax
  2. Wikipedia. Tic-tac-toe. https://en.wikipedia.org/wiki/Tic-tac-toe


Sugam Baskota

Sugam Baskota is a senior software engineer and Computer Science graduate from UT Arlington, with interests in user scripts, browser extensions, developer tooling, and productivity systems. He spends time building practical utilities and extensions in the kinds of workflows Eon is designed to simplify. At Eon Tools, he reviews useful, password, and developer tools.