Chess is a board game for two players, played on a square board consisting of 64 squares arranged in an 8×8 grid. The players, referred to as "White" and "Black", each control sixteen pieces: one king, one queen, two rooks, two bishops, two knights, and eight pawns, with each piece type having a different pattern of movement. An enemy piece may be captured (removed from the board) by moving one's own piece onto the square it occupies. The objective of the game is to checkmate (threaten with inescapable capture) the enemy king. There are also several ways a game can end in a draw.

The recorded history of chess dates back to the emergence of chaturanga in 7th-century India. Chaturanga is also thought to be an ancestor of similar games like janggi, xiangqi, and shogi. After its introduction to Persia, it spread to the Arab world and then to Europe. The modern rules of chess emerged in Europe at the end of the 15th century, becoming standardized and gaining universal acceptance by the end of the 19th century. Today, chess is one of the world's most popular games, with millions of players worldwide.

Organized chess arose in the 19th century. International chess competitions today are governed by FIDE (, ). The first universally recognized World Chess Champion, Wilhelm Steinitz, claimed his title in 1886; Gukesh Dommaraju is the current World Champion, having won the title in 2024.

A large body of chess theory has developed since the game's inception. Aspects of art are found in chess composition, and chess has in turn influenced Western culture and the arts, and has relevance to other fields such as mathematics, computer science, and psychology. One of the goals of early computer scientists was to create a chess-playing machine. In 1997, Deep Blue became the first computer to win a against a reigning World Champion when it defeated Garry Kasparov. Modern chess engines are significantly stronger than human players and have greatly influenced the development of chess theory. Chess, however, is not a solved game.

Rules

The rules of chess are published by FIDE (, 'International Chess Federation'), world governing body of chess, in its Handbook. Rules published by national governing bodies, or by unaffiliated chess organizations, commercial publishers, etc., may differ in some details. For example, the United States Chess Federation (USCF) diverged from FIDE in the 1980s over differences in time-keeping rules.

Setup

Chess sets come in a wide variety of styles. The Staunton pattern is the most common, and is usually required for competition. Chess sets come with pieces in two colors, referred to as white and black, regardless of their actual color; the players controlling the color sets are referred to as White and Black, respectively. Each set comes with at least the following 16 pieces in both colors: one king, one queen, two rooks, two bishops, two knights, and eight pawns.

The game is played on a square board of eight rows (called ) and eight columns (called ). Although it does not affect gameplay, by convention the 64 squares alternate in color and are referred to as and squares.

To start the game, White's pieces are placed on the first rank in the following order, from left to right: rook, knight, bishop, queen, king, bishop, knight, rook. Pawns are placed on each square of the second rank. Black's position mirrors White's, with equivalent pieces on every file. The board is oriented so that the right-hand corner nearest each player is a light square; as a result the white queen always starts on a light square, while the black queen starts on a dark square. This may be remembered by the phrases "white on the right" and "queen on her color".

In informal games, colors may be decided either by mutual agreement, or by lot. The rules of chess do not prescribe any particular method for deciding colors by lot, but a common traditional method is to conceal a white pawn in one hand and a black pawn in the other and have the opponent choose.

In competitions, the piece colors are normally allocated to players by the organizers, but occasionally are decided by lot, for example in the first round of a player vs. player match or a team vs team match. In this case, the organizers are free to use any method they wish to decide the colors, from a simple coin toss or card draw, to more creative methods. For example, at the U.S. China Chess Summit, a friendly match between the two countries played in Seattle in 2001, the first round colors were decided by a game of Jenga, won by the Chinese.

Movement White moves first, after which players alternate turns. One piece is moved per turn (except when castling, during which two pieces are moved). In the diagrams, dots mark the squares to which each type of piece can move if unoccupied by friendly pieces and there are no intervening piece(s) of either color (except the knight, which leaps over any intervening pieces). With the sole exception of en passant, a piece captures an enemy piece by moving to the square it occupies, removing it from play and taking its place. The pawn is the only piece that does not capture the way it moves, and it is the only piece that moves and captures in only one direction (forwards from the player's perspective). A piece is said to control empty squares on which it could capture, attack squares with enemy pieces it could capture, and defend squares with pieces of the same color on which it could recapture. Moving is compulsory; a player may not skip a turn.

The king moves one square in any direction. There is also a special move called castling which moves the king and a rook. The king is the most valuable piece—it is illegal to play any move that puts one's king under attack by an opponent piece. A move that attacks the king must be parried immediately; if this cannot be done, the game is lost. (See .) A rook can move any number of squares along a rank or file. A rook is involved in the king's castling move. A bishop can move any number of squares diagonally. A queen combines the power of a rook and bishop and can move any number of squares along a rank, file, or diagonal. A knight moves to any of the closest squares that are not on the same rank, file, or diagonal. (Thus the move forms an "L"-shape: two squares vertically and one square horizontally, or two squares horizontally and one square vertically.) The knight is the only piece that can leap over other pieces. A pawn can move forward to the unoccupied square immediately in front of it on the same file, or on its first move it can optionally advance two squares along the same file, provided both squares are unoccupied (diagram dots). A pawn can capture an opponent's piece on a square diagonally in front of it by moving to that square (diagram crosses). It capture a piece while advancing along the same file, nor can it move to either square diagonally in front without capturing. Pawns have two special moves: the en passant capture and promotion.

Check and checkmate

When a king is under immediate attack, it is in check. A move in response to a check is legal only if it results in a position in which the king is no longer in check. There are three ways to counter a check: Capture the checking piece. Interpose a piece between the checking piece and the king (possible only if the attacking piece is a queen, rook, or bishop and there is a square between it and the king). Move the king to a square where it is not under attack.

The object of the game is to checkmate the opponent; this occurs when the opponent's king is in check, and there is no legal way to get it out of check. In casual games, it is common to announce "check" when putting the opponent's king in check, but this is not required by the rules of chess and is usually not done in tournaments.

Castling

Kings can castle once per game. Castling consists of moving the king two squares toward either rook of the same color, and then placing the rook on the square that the king crossed over. After castling, both pieces continue to move according to their normal movement rules.

Castling is possible only if the following conditions are met: Neither the king nor the rook has previously moved during the game. There are no pieces between the king and the rook. The king is not in check and does not cross or finish on a square controlled by an enemy piece.

Castling is still permitted if the rook is under attack, or if the rook would cross an attacked square. It is also still permitted if the king had been in check earlier in the game, provided that the check was resolved without moving the king.

Special pawn moves

Pawns have two special moves: En passant: A pawn can be captured en passant ("in passing") after it makes a two-square advance to the same rank as an opponent's pawn on an adjacent file, whereupon the opponent's pawn moves to one square behind the captured pawn. A pawn can be captured en passant only on the turn after it makes a two-square advance. In the animated diagram, the black pawn advances two squares from g7 to g5, and the white pawn on f5 takes it en passant, landing on g6. Promotion: A pawn is promoted when it advances to its , being replaced with the player's choice of a queen, rook, bishop, or knight. Usually, pawns are promoted to queens; choosing another piece is called underpromotion. In the animated diagram, the c7-pawn is advanced to c8 and promoted to a queen. If the required piece is not available (e.g. a second queen), an inverted rook is sometimes used as a substitute, but this is not recognized in FIDE-sanctioned games.

End of the game

Win A game can be won in the following ways: Checkmate: The opposing king is in check and no move can get it out of check. (See .) Resignation: A player may resign, conceding the game to the opponent. If, however, the opponent has no way of checkmating the resigned player, this is a draw under FIDE Laws. Most tournament players consider it good etiquette to resign in a hopeless position. Win on time: In games with a time control, a player wins if the opponent runs out of time, even if the opponent has a superior position, as long as the player has a theoretical possibility to checkmate the opponent were the game to continue. Forfeit: A player who cheats, violates the rules, or violates the rules of conduct specified for the particular tournament can be forfeited. Occasionally, both players are forfeited.

Draw There are several ways a game can end in a draw: Stalemate: If the player to move has no legal move, but is not in check, the position is a stalemate, and the game is drawn. Dead position: If neither player is able to checkmate the other by any legal sequence of moves, the game is drawn. For example, if only the kings are on the board, all other pieces having been captured, checkmate is impossible and the game is drawn by this rule. On the other hand, if each player still has a knight, there is a theoretical albeit highly unlikely possibility of checkmate, so this rule does not apply. The dead position rule supersedes an older rule that referred to "insufficient material", thereby extending it to include other positions in which checkmate is impossible, such as blocked pawn endings in which the pawns cannot be attacked.