# Tic-Tac-Toe

Classic 3×3 tic-tac-toe against a random AI, an unbeatable minimax AI, or a friend. Keeps score across rounds.

> Canonical page: https://elysiatools.com/en/tools/tic-tac-toe

- **Category:** Games

- **Keywords:** tic-tac-toe, noughts and crosses, minimax, ai opponent, two players, game

## Overview

Play the classic 3x3 Tic-Tac-Toe game directly in your browser against a random AI, an unbeatable minimax AI, or a friend in local two-player mode, complete with score tracking across rounds.

## Inputs

- **Opponent Mode** (select)
- **First Player** (select)

## When to use

- When you want to test your strategic skills against an unbeatable minimax AI algorithm.
- When you need a quick, casual game to pass the time with a friend on the same device.
- When you want to practice basic game theory patterns against a randomized, easy AI opponent.

## How it works

- Select your opponent mode, choosing between Easy AI, Hard AI (minimax), or local Two-player mode.
- Choose which player goes first, setting yourself as Player X or letting the opponent start as Player O.
- Click on the 3x3 grid to place your mark and take turns until a player gets three in a row or the board is full.
- View the updated score tracker at the end of each round and reset the board to play again.

## Use cases

- Challenging yourself to draw against an unbeatable minimax algorithm.
- Playing a quick local match with a friend or colleague during a break.
- Demonstrating basic game theory and decision-tree logic to students using the minimax AI.

## Frequently asked questions

### Can I actually beat the Hard AI mode?

No, the Hard AI uses the minimax algorithm, which plays optimally. The best possible outcome against it is a draw.

### Does the game keep track of scores across multiple rounds?

Yes, the game automatically tracks wins, losses, and draws across consecutive rounds.

### Can two people play on the same computer?

Yes, select the 'Two players (local)' option to take turns playing on the same screen.

### Who goes first in the game?

You can configure the first player to be either Player X (you) or Player O (the opponent) before starting.

### What is the difference between the Easy and Hard AI?

The Easy AI makes random moves, while the Hard AI uses a minimax algorithm to block your moves and play flawlessly.

## Related tools

- [Hangman Game](https://elysiatools.com/en/tools/hangman-game): Classic hangman word-guessing game. Guess the hidden word letter by letter; six wrong guesses ends the game. Three difficulty levels, with general, animals, food, and science categories.
- [Magic 8 Ball](https://elysiatools.com/en/tools/magic-8-ball): The classic Magic 8 Ball. Ask any yes-or-no question, shake, and get one of 20 traditional answers (yes / no / uncertain). Classic English phrases or localized translations.
- [Mastermind Game](https://elysiatools.com/en/tools/mastermind-game): Classic Mastermind code-breaking game. The computer picks a secret color code; you guess row by row. Black pegs = right color and position; white pegs = right color, wrong position.
- [Rock Paper Scissors](https://elysiatools.com/en/tools/rock-paper-scissors): Classic rock-paper-scissors with a random opponent or an adaptive AI that learns your patterns. Shake animation, running score, and history.
- [Deck Shuffler](https://elysiatools.com/en/tools/deck-shuffler): Shuffle a standard deck of playing cards
- [Poker Outs and Equity Simulator](https://elysiatools.com/en/tools/poker-out-simulator): Simulate Texas Hold'em equity against random opponents, estimate win and tie rates, and list next-card improvement outs
- [Minesweeper](https://elysiatools.com/en/tools/minesweeper): Classic minesweeper with beginner, intermediate and expert presets, or custom boards. First click safe, flood-fill, right-click flags, chord on numbers.
- [Trivia Quiz](https://elysiatools.com/en/tools/trivia-quiz): Test your knowledge with a trivia quiz. Random questions from a built-in English bank across science, history, geography, and general topics. Pick 1 of 4; get your score and accuracy at the end.

## Samples

- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion

## Related content

- [Classic Browser Games and Quick Puzzles](https://elysiatools.com/en/hubs/classic-browser-games): Pick an instant browser game for a short break, from 2048 and Minesweeper to trivia and two-player classics.
