Moves
Play Chess Online vs the Computer
Play a full game of chess directly against the computer, free, in your browser, with no download and no sign-up. Choose whether you play White or Black, pick a difficulty, and click or drag a piece to one of the highlighted squares. Every rule is here — castling, en passant, pawn promotion, check, checkmate and stalemate — and the opponent is a real chess engine, not a lookup table. Legal moves are shown for the piece you pick up, your game is written out in algebraic notation as a live move list, captured pieces and the material score are always on screen, and your wins, losses and draws are tracked per difficulty. Prefer to play a person? Flip the mode to 2 Players for a pass-and-play game on the same device.
How the AI thinks
The computer opponent is a genuine game-tree search engine, the same family of algorithm behind classic chess programs. On every move it generates the fully legal moves — respecting pins, checks and castling rights — and then runs negamax with alpha-beta pruning: it plays out sequences of moves for both sides, scores the resulting positions, and chooses the move with the best guaranteed outcome, skipping branches that provably cannot matter. To avoid grabbing a piece right before the recapture, it extends every leaf with a quiescence search that keeps looking while captures are still on the board. Positions are scored by material plus a positional evaluation — piece-square tables (knights in the centre, rooks on open files), king safety, pawn structure (doubled, isolated and passed pawns), the bishop pair and rooks on open files. It searches with iterative deepening and null-move pruning, and extends the search when a king is in check so it doesn't miss forcing tactics. There are four levels: Beginner hangs pieces on purpose, Medium plays a solid game, Hard thinks about a second per move, and Expert searches deeper still at about two seconds per move. The whole engine runs locally in your browser in a background worker thread, so the page stays responsive and nothing is sent to a server. At its strongest it is a strong club-level opponent, though we do not claim it is perfect or grandmaster-strength.
How to play chess — the rules
- Goal. Checkmate the opponent's king — attack it so that it cannot escape capture on the next move. You never actually capture the king; the game ends at checkmate.
- How the pieces move. Pawns step forward one square (two from their start) and capture diagonally; knights jump in an L; bishops move diagonally; rooks move in straight lines; the queen does both; the king moves one square in any direction.
- Special moves. Castling tucks your king to safety and activates a rook; en passant lets a pawn capture a pawn that just slipped past it; a pawn that reaches the far rank promotes, usually to a queen.
- Check and mate. If your king is attacked you are in check and must get out of it. If you cannot, it is checkmate and you lose. If you have no legal move but are not in check, it is stalemate — a draw.
- Draws. Games are also drawn by the fifty-move rule, by threefold repetition, or when neither side has enough material to checkmate.
- Hint and undo. Hint asks the engine for a strong move; Undo takes back your last move and the computer's reply. Flip turns the board around.
Tips to beat the AI
- Develop and castle early. Bring your knights and bishops out toward the centre in the opening and castle your king to safety before you launch an attack.
- Control the centre. Pawns and pieces that command the four central squares give your army more room and more good moves.
- Don't hang pieces. Before every move, check what the reply is — the engine will happily take anything you leave undefended, and against Beginner you can win material the same way.
- Trade when ahead, attack the king when the centre is closed. Simplifying into an endgame with an extra piece is the cleanest way to convert a lead against the computer.
FAQ
Can I play chess against the computer for free?
Yes — that is exactly what this page is. Pick a difficulty, choose your colour, and play. Works on desktop and mobile, free, with no account.
How strong is the AI?
There are four levels. Beginner plays some deliberately weak moves; Medium plays a solid game; Hard runs a negamax search with alpha-beta and null-move pruning, a quiescence search and a positional evaluation (king safety, pawn structure, bishop pair, open files), thinking about a second per move; and Expert searches deeper at about two seconds per move — a strong club-level opponent, though we don't claim perfection.
Does it support castling, en passant and promotion?
Yes — the full rules of chess, including all three special moves plus check, checkmate, stalemate and the standard draw rules.
Can I play a friend on the same device?
Yes. Switch the mode to 2 Players for a local pass-and-play game with no engine involved.
Is it free? Does it work offline?
Completely free, no download, no sign-up. The engine runs client-side, so once loaded the game keeps working without a connection. More AI games: AI Checkers, AI Othello, AI Connect 4, AI Tic Tac Toe or AI Minesweeper.
More AI games on LK Forge
Checkmate — you win!
Well played.