Chess
Play chess against the computer at three levels or with a friend: every rule including castling, en passant and promotion, plus move list and FEN.
How to play
- White moves first. Tap one of your pieces: the squares it can move to are marked. Tap one of them to move.
- Pieces: the king moves one square any way; the queen any distance in a straight line; rooks along ranks and files; bishops diagonally; knights in an L and can jump; pawns move forward one square (two from their first square) and capture one square diagonally forward.
- Castling: the king moves two squares towards a rook and the rook jumps over it, if neither has moved, the squares between are empty and the king is not in check and does not pass through or land on an attacked square. Tap the king, then the square two away.
- En passant: a pawn that has just moved two squares can be taken by an enemy pawn beside it as if it had moved one. A pawn reaching the last rank is promoted: choose queen, rook, bishop or knight.
- Checkmate (the king is attacked and cannot escape) wins. Stalemate, the 50-move rule, the same position three times or too few pieces to mate are draws.
Keyboard and touch
| Arrow keys | Move around the board |
| Enter or Space | Pick up the piece on the square, or move the picked piece there |
| Tab | Leave the board for the buttons |
| Tap | Tap a piece, then one of the marked squares |
Tips
- Control the centre with pawns and pieces early, and castle to keep your king safe.
- Develop knights and bishops before moving the queen out.
- Before every move, ask: what does my opponent threaten?
- Copy the FEN line to save a position, or paste one to study it. Easy looks one move ahead and sometimes picks a weaker move; medium looks 2-3 moves ahead; hard searches deeper for up to about two seconds.
About this game
Chess with all of its rules, written from scratch for this page. The move generator is checked against the published perft move counts (the number of possible positions after 1, 2, 3 and 4 moves from known test positions, such as 197,281 after four plies from the start); every count matches. The computer player uses an alpha-beta search with piece values and simple square tables. Moves are listed in standard algebraic notation. Everything runs in your browser.