Key square

In chess, particularly in endgames, a key square (also known as a critical square) is a square such that if a player's king can occupy it, he can force some gain such as the promotion of a pawn or the capture of an opponent's pawn. Key squares are useful mostly in endgames involving only kings and pawns. In the king and pawn versus king endgame, the key squares depend on the position of the pawn and are easy to determine. Some more complex positions have easily determined key squares while other positions have harder-to-determine key squares. Some positions have key squares for both White and Black.

King and pawn versus king
In an endgame with a king and pawn versus a king, the key squares are relative to the position of the pawn. Assume that White has the pawn. If the white king can occupy a key square, he can force the promotion of the pawn but accurate play is required. Whether or not the white king can reach a key square depends on the position of the pieces and which player is to move.

Rook pawn
An advanced generally has two key squares: the two squares on the adjacent  that touch the promotion square, i.e. b7 and b8 for a white a-pawn, and g7 and g8 for a white h-pawn. The key squares are indicated by the black dots in the position in the diagram. If White's king can reach either of the two key squares, he can keep Black's king away and the pawn will promote. If the Black king can reach any of the squares marked with a dot or an " × ", it stops the pawn – either by blocking the pawn or preventing the white king from reaching a key square.

Other pawns
Pawns other than rook pawns have more key squares. If the pawn is on the second, third, or fourth, there are three key squares – the square two squares in front of the pawn and the squares to the left and right of that square. The key squares are indicated by the black dots in the diagrams above. If the pawn is on the fifth or sixth rank, there are six key squares: the square in front of the pawn and the squares to the left and right, as well as the square two squares in front of the pawn, and the squares to the left and right of it, see the middle diagram. When the pawn is on the seventh rank, the key squares are the squares on the seventh and eighth rank that touch the pawn's square (see the diagram on the right).

An easy way to remember the key squares is to note that if the pawn is not beyond the midpoint of the board, there are three key squares that are two ranks ahead. If the pawn is on the fifth or sixth rank there are six key squares on the two ranks in front of the pawn. If the pawn is on the seventh rank, the adjoining squares on the seventh and eighth ranks are key squares.

An exception
There is an exception to the key squares rule with a on its sixth rank, the defending king in the corner, and the defender to move. In the diagram, with the white king on either the square indicated or the square marked by " × ", the position is stalemate if Black is to move.

Example from game
This position from a game between Svetozar Gligorić and Bobby Fischer illustrates key squares. Black to move can keep the white king from reaching a key square by 57...Kb8, so the game is drawn. If the white king moves to the fifth, Black takes the opposition. (See Opposition (chess) for more details of this game.)

Blocked pawns
In a position with a blocked pair of pawns (opposing pawns on the same ), the key squares for a player's king extend for three files on either side of the opponent's pawn. In this position, the first king to reach one of his key squares will win the opponent's pawn and protect his own. Even though the white king is farther away from the pawns, White wins if he moves first:
 * 1. Kg3 Kb7
 * 2. Kf4 Kc7
 * 3. Ke5 Kd7
 * 4. Kd5 Kc7
 * 5. Ke6

The white king reaches a key square.
 * 5... Kc8
 * 6. Kd6 Kb7
 * 7. Kd7 Kb8
 * 8. Kc6 Ka7
 * 9. Kc7 Ka8
 * 10. Kxb6 and White wins (see king and pawn versus king endgame).

When both kings can reach a key square, a position of mutual zugzwang may occur. The first king to attack the opposing pawn must save a square for attack and defense (the squares marked " × "). With White to move:
 * 1. Kd7!

The only winning move; all other moves lose. For instance, if 1.Kd6 then 1...Kf5 puts White in zugzwang and Black wins.
 * 1... Kf5
 * 2. Kd6!

Now Black is in zugzwang.
 * 2... Kg6
 * 3. Kxe6 and White wins.

Example with a protected passed pawn
In this example, White would win if his king could get to any of the key squares (marked by the white dots). But Black is able to prevent this and draw the game – with or without the move. For example:
 * 1. Kd2 Kd5
 * 2. Ke3 Ke5

The only move to draw.
 * 3. Kf3 Kf5

The only move to draw.
 * 4. Kg3 Ke5
 * 5. Kg4 Ke4

The only move to draw.

Example with more pawns
In this example, f6 is also a key square for the white king. White to move wins; Black to move draws. (All of Black's moves are the only move to draw.)
 * 1... Kh6
 * 2. Kc7 Kg7
 * 3. Kb7 Kh7
 * 4. Kb8 Kh8
 * 5. Kc8 Kg8
 * 6. Kd7 Kh7
 * 7. Ke6 Kg6!.

Any key square by any route
With a king and pawn versus a lone king, it is important to get the attacking king to any key square and the path to a key square is not always direct. For instance, in the diagram, the key squares for the white king are b5, c5, and d5. Black can prevent the white king from reaching a key square directly, for example:
 * 1. Kd2 Ke7
 * 2. Kd3 Kd7
 * 3. Kc4 Kc6

Taking the opposition; however, the white king can reach a key square (b5) by going on the other side of the pawn:
 * 1. Kc2! Ke7
 * 2. Kb3 Kd6
 * 3. Kb4 Kc6
 * 4. Kc4

Opposition, and Black is in zugzwang.
 * 4... Kd6
 * 5. Kb5

or
 * 4... Kb6
 * 5. Kd5

and the white king has occupied a key square and has a winning position.