Chess
Play against the computer on easy, medium or hard, or with a friend on the same device. Your game is saved in this browser, so you can come back to it later.
Click a piece, then a square, or drag it · Dots show the legal moves · Your game is saved automatically
How to play
Pick a level and a colour and press New game. White always moves first. To move, click or tap one of your pieces and then a highlighted square, or drag the piece there. Dots mark the empty squares it can move to, and rings mark pieces it can capture. When a pawn reaches the last rank you choose what it becomes.
- Undo takes back your last move (and the computer's reply). Hint asks the engine for a good move and highlights it.
- Flip board turns the board round, which helps in 2-player mode when you pass the device across the table.
- Copy PGN copies the whole game in standard notation, so you can paste it into Lichess, Chess.com or any chess program to analyse it. Copy FEN copies just the current position.
- Changing the mode, level or colour in the middle of a game takes effect when you start a new game, so a stray click never throws away your position.
The rules in brief
- Check and checkmate: a king that is attacked is in check, and you must get out of it. If there is no way out, it's checkmate and the game is over.
- Castling: move the king two squares towards a rook and the rook jumps over it. Neither piece may have moved before, the squares between them must be empty, and the king may not be in check or pass through an attacked square.
- En passant: if a pawn moves two squares and lands beside an enemy pawn, that pawn may capture it as if it had moved only one square, but only on the very next move.
- Draws: stalemate (the player to move has no legal move but isn't in check), the same position three times, 50 moves by each side with no capture or pawn move, or too little material left to checkmate (for example king and bishop against king).
About the computer
The computer opponent is a small chess engine written for this page. It runs in a background thread in your browser, so nothing is sent anywhere. It looks ahead with an alpha-beta search, checks captures until the position is quiet, and judges positions by material and piece placement. On Easy it looks only one move ahead, makes deliberate mistakes and sometimes plays a random move, which suits beginners. Medium looks three moves ahead with a little randomness and plays like a casual club player. Hard thinks for about two seconds a move, usually 5 to 7 moves deep, and punishes loose pieces. It plays a few well-known openings for variety. Your wins against each level are counted in this browser.
Tips for beginners
- Control the centre with your pawns and develop your knights and bishops early.
- Castle within the first ten moves to keep your king safe.
- Before every move, ask: what does my opponent's last move threaten?
- Don't bring your queen out too early, where it can be chased around.