Options
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.
Curious how it decides? Watch minimax and alpha-beta run, step by step → Or see how much a deeper search is worth → Or read how the Chess AI works →
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.
Want to go deeper? Read our guide on how to analyze a chess position with a free online analyzer — or the same for checkers, Othello, backgammon, and mancala.
FAQ
Can I play chess against the computer for free?
Yes — this page is chess played directly against the computer in your browser. There is nothing to download and no account to create: choose a difficulty and whether you play White or Black, then click or drag a piece to one of the highlighted squares. It works on desktop and mobile and is completely free.
How strong is the chess AI?
The chess AI's strength depends on the level, and there are four. Beginner deliberately plays some weak moves, so it hangs pieces you can win. Medium plays a solid game a few moves deep. Hard runs a real chess engine — negamax search with alpha-beta pruning, null-move pruning, a capture quiescence search and a positional evaluation (king safety, pawn structure, passed pawns, bishop pair, open files) — thinking about a second per move. Expert uses the same engine but searches deeper, thinking about two seconds per move, and is a strong club-level opponent. We do not claim it plays perfectly or at grandmaster strength.
Does this chess game support castling, en passant and promotion?
Yes, this chess game supports all of it. The engine implements the full rules of chess: castling on both sides (including the checks that make it legal), en passant pawn captures, and pawn promotion — when your pawn reaches the far rank you choose a queen, rook, bishop or knight. Check, checkmate, stalemate, the fifty-move rule, threefold repetition and insufficient-material draws are all handled.
Can I play two-player chess on the same device?
Yes — two-player chess works on the same device: switch the mode from "vs Computer" to "2 Players" and the board becomes a local pass-and-play game. White and Black take turns on the same screen, with legal-move highlights and the full move list, and no engine involved. It is a quick way to play a friend next to you without an account.
Is the chess game free and does it work offline?
This chess game is completely free, with no download and no sign-up. The game and the chess engine run entirely client-side in your browser, in a background worker thread, so once the page has loaded it keeps working even without a connection. Your win, loss and draw record is stored locally in your browser. 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.
Stuck on a position? Feed it to the chess position solver for the best move and an evaluation.