HomeLearn to Play ChessImprove Your GameChess HistoryChess for FunChess Blog

Middle game - King safety
Why, when, and where to castle.

Since the loss of the King means loss of the game, the player whose King is well protected has a big advantage over an opponent whose King is poorly protected. King safety is an important element of positional play (see the link box at the bottom).

In the opening of a game, the players typically push their center Pawns to occupy the center and to open lines for the development of the pieces. One consequence of the opening is that the King, who starts the game on a central file, becomes exposed to attacks from the opposing pieces. Keeping the King for too long on its initial square often leads to catastrophic problems.

Castling (see the link box again if you're not sure how to castle) serves two purposes. It:-

  • places the King in relative safety, and
  • furthers the development of the castling Rook.

The castling move was introduced in the 15th century during the great reform of chess rules which created the modern game. Ever since Ruy Lopez simplified the many variants in 1561 to create today's standard, players have been faced with two key questions in every chess game:-

  • when to castle?
  • where to castle : Kingside, Queenside, or not at all?
The answer to both questions is, 'It depends'. It depends on the other details of the position.

When to castle

Castling occurs once in a game and fixes the long-term residence of the King. This makes it an important strategic decision.

For offense, aiming the pieces at the opponent's King is a common strategy, so knowing the address of the King helps to develop the forces. For defense, keeping a piece or two near the King is also a common strategy, so knowing the address of the King helps here, too.

Same side or not?

When both Kings castle to the same side -- both on the Kingside or both on the Queenside -- it is risky for either player to launch a Pawn attack against the opposing King. This is because at the same time the moving Pawns threaten the opposing King, they move away from the protection of their own King.

When the Kings castle to opposite sides -- one on the Kingside and one on the Queenside -- both players routinely launch a Pawn attack against the opposing King. Now the Pawns that threaten the opposing King aren't the same Pawns which protect their own King.

For these reasons, both players often wait for the other to castle first. Once one of the players has committed the King to one side, the other player can castle to that side or to the opposite side, depending on plans for the next phase of the game.

In other games it becomes obvious at an early stage which side is best for one or both Kings to castle. Following the principle of playing obvious moves first, a player may choose to castle as fast as possible.

Offense or defense?

As the only move involving two pieces at the same time, castling can be done for offensive reasons, for defensive reasons, or for both. Sometimes a player castles because the castling Rook is needed to occupy an open file immediately -- this is offensive. At other times a player castles because the risk of keeping the King in the center is increasing with every move -- this is defensive. A player who is attacking may decide to delay castling only because it puts no new pressure on the opponent.

Castling occasionally wins a game outright. Here is a rare case of castling to deliver checkmate.

16.O-O is mate. The position is from a variation of Ed. Lasker - Thomas, London 1911, which did not occur in the real game. Instead, White delivered checkmate a few moves later with 18.O-O-O.

To castle or not?

After the Queens have been exchanged, the center is almost as safe as the corner. This is the same principle that allows a King to become active in the endgame.

Sometimes castling can be dispensed with altogether. This option usually arises when the Queens are traded early. Here's an example.

After 1.d4 d6 2.c4 e5 3.dxe5 dxe5 4.Qxd8+ Kxd8, Black's King is in no particular danger in the center, although it does interfere with the development of the Black Rooks. Black will have to find another square for the King in order to develop the Rooks to the center files.

With the Queens on the board, there is one tried-and-true piece of advice on when to castle. Castle before your opponent forces you to give up the castling option. Similarly, if you can prevent your opponent from castling, you'll usually have the upper hand.

Where to castle

Even before you have the possibility to castle, you should be considering where your King will be best placed : Kingside, Queenside, or in the center. The main elements behind this decision are

  • the pawn structure that will protect your King, and
  • any open lines that can be used against your King.
As mentioned in the discussion about castling on opposite sides, the position of your opponent's King is another factor.

Two moves or one?

At first glance it may seem that castling Queenside is more efficient than Kingside. After O-O, you need to play another Rook move like Re1 (Re8 for Black) or Rd1 (Rd8) to bring the King Rook into play on a center file. After O-O-O, the Queen Rook is already developed on a center file.

It may seem that Queenside castling gains a move, but things are not so simple. Because the a-Pawn is unprotected after O-O-O, the King must often move to b1 (b8) to protect it. This second King move can also be necessary to get the King off the c1-h6 (c8-h3) diagonal.

O-O-O and Kb1 O-O and Re1

These diagrams show that two moves are usually required when castling on either side.

Pawn structure

The Pawns in front of the King play the main role in its protection. The most solid formation is when all Pawns in front of the King are on their initial squares.

There's a drawback to castling : the King sitting in a corner behind its own Pawns can be easier to attack than when it is in the center. The same Pawns that provide protection to the King also restrict its mobility.

The Pawn structure in the preceding diagram has a serious disadvantage : back-rank mates. Many games end in mate because a King has no escape from an opposing Queen or Rook checking on the back rank. Here's an early example from the first international tournament in chess history.

In game 3 of the final match of the London 1851 knockout tournament, Anderssen played 1.Qxa8. Wyvill resigned because 1...Rxa8 2.Rd8+ is mate next move, and on any other move, Black has lost a Rook for nothing.

The safest protection against back-rank mates is to move one of the Pawns in front of the castled King. Which Pawn should you move? As you may have already discovered, when a Pawn advances it creates a weakness. This weakness can provide a target for an attack. Let's look at some examples.

Bear in mind that although the next few diagrams show the White King castled on the Kingside, the remarks are equally relevant for a King castled on the Queenside. And, of course, they also apply to a castled Black King.

g3 h3

In the first diagram, White has played g3 to create an escape square on g2 against back-rank mates. At the same time, the move has created one hole on f3 and another hole on h3. Black's pieces can move to either square without fear of being attacked by a White Pawn.

In the second diagram, White has played h3 to create an escape square on h2. Unlike the previous diagram, the move has not created a hole. The Pawn on f2 prevents any Black piece from moving to g3.

f3 f4

In the first diagram, White has played f3 to create an escape on f2. This may look similar to the position after h3, but there is a big difference. The move f3 has created a hole on e3. It has also blocked the square f3 so that White can no longer move a Knight to that square. A Knight on f3 is a natural protector of the castled King.

Even worse, the move f3 is considered passive : it puts no pressure on Black. If White wants to move the f-Pawn to create an escape square, f4 is better. Although it also leaves a hole on e3 (and on e4), it strikes Black's center and threatens to move to f5, menacing the Black position. When supported by a Rook, as shown in the diagram, f4 is a dangerous attacking move at the same time that it creates an escape square for the White King.

There are many other possible Pawn formations around the castled King. Whenever you move a Pawn near your King, consider the long-range impact on your King's safety as well as the impact on your opponent's position.

Open lines

Pawn structure is not the only consideration for the castled King. Open lines are just as important and are often the basis for attacks on the castled King.

Here we give two examples of such attacks. There are many other examples and some writers have attempted to classify them according to different sacrificial themes.

In this diagram the b1-h7 diagonal is an open road to Black's King. Black can't close it with f5. After 1.Qc2 f5 2.exf6 Nxf6 3.Ng5 g6 4.Bxg6 hxg6 5.Qxg6+, White mates.

In this diagram Black threatens mate with 1...Qg2. If White defends with 1.Rg1, Black mates with 1...Qxh2+ 2.Kxh2 Rh5. The holes on f3 and h3 let Black's pieces approach the White King. Then the 5th-rank and the h-file helped to deliver the decisive blow.

In future articles we'll look at other typical attacks on the castled King. We'll discuss when it's safe for the King to emerge from the corner. Don't forget that, when it comes to your King, safety is the first priority!

 Related Resources
• How to Castle
• Tactical Play
• Positional play
• Part 1 - Patterns
• Part 2 - Combinations
• Part 3 - Plans
• Part 4 - Double Attacks
• Part 5 - Open Lines
• Part 6 - King Safety
• Part 7 - Pawn Structure
• Part 8 - Piece Placement and Chess Strategy
• Part 9 - Kasparov - X3D Fritz, New York, 2003