Castling is a move in the game of chess in which a player moves the king two squares toward a rook on the same rank and moves the rook to the square that the king has crossed. It is the only move in chess in which a player moves two pieces in the same move.
Castling may be done only if neither the king nor the rook has previously moved, the squares between the king and the rook are unoccupied, the king is not in check, and the king does not cross over or end up on a square attacked by an opposing piece.
Castling with the king's rook is known as castling kingside or castling short, and castling with the queen's rook is known as castling queenside or castling long; here, short and long refer to the distance the rook moves. The notation for castling, in both the algegraic and descriptive systems, is 0-0 for castling kingside and 0-0-0 for castling queenside.
Castling originates from the king's leap, a two-square king move added to European chess between the 14th and 15th centuries form in the 17th century; however, local variations in castling rules were common, persisting in Italy until the late 19th century. Asian games of the chess family, such as shogi, xianggi, and janggi, but it is commonly included in variants of Western chess.
When castling, the king is transferred two squares toward a rook of the same color on the same rank, and the rook transferred to the square crossed by the king. There are two forms of castling:
- Kingside castling (castling short) consists of placing the king on the king's knight's square (g1 for white and g8 for black) and the rook on the king's bishop's square (f1 for white and f8 for black).
- Queenside castling (castling long) consists of placing the king on the queen's bishop's square (c1 for white and c8 for black) and the rook on the queen's square (d1 for white and d8 for black).
Castling is permissible provided all of the following conditions hold:
- Neither the king nor the rook has previously moved.
- There are no pieces between the king and the rook.
- The king is not currently in check.
- The king does not pass through a square that is attacked by an opposing piece.
- The king does not end up in check. (True of any legal move.)