Tic-Tac-Toe AI

Play tic-tac-toe against AI. Three difficulty levels. Hard mode is unbeatable.

Game Settings

Wins 0Losses 0Draws 0
Difficulty:
Side:

Your turn (X)

Usage

Features

Tic-tac-toe (noughts and crosses) is a classic two-player game. On a 3×3 board, players take turns placing pieces; the first to connect three in a row (horizontally, vertically, or diagonally) wins. This tool offers three AI difficulty levels. Hard mode uses the Minimax algorithm; the best possible result is a draw.

Difficulty Levels

Easy: AI moves randomly; Medium: AI wins when possible, blocks when needed, otherwise random; Hard: AI uses the Minimax algorithm to exhaust all possibilities — unbeatable, best result is a draw.

Steps

Choose difficulty and side (X first or O second); click an empty cell to place a piece; AI responds automatically; connect three in a row to win. Win/loss/draw stats are saved locally.