Black to move
- Input
- 8/8/8/3k4/8/3K4/3P4/8 b
- Expected output
- loss for the side to move, DTZ -8, DTM -40
Black, with the move, loses: White wins with perfect play, in 20 moves to mate.
Chess Endgame Tablebase (up to 7 Pieces)
opposition in chess king and pawn endgame
In the opposition, the kings face each other with one empty square between them, and whoever has to move must give ground. In king and pawn endings this decides between winning and drawing. With the tablebase you see the same position with opposite results depending on the turn.
Black, with the move, loses: White wins with perfect play, in 20 moves to mate.
With White to move, the same position is a draw: White loses the opposition by moving.
It is a database with the perfect result of every position with few pieces. For each position it says whether the side to move wins, draws or loses, and in how many plies. The Syzygy tablebase this tool queries covers up to 7 pieces, kings included.
It is most decisive there, but it shows up in any ending where the kings fight for squares, such as king and queen against king, where each side's king helps the mate.
It is a king maneuver: the king takes three steps forming a triangle to return to the same square, while the enemy king merely alternates between two squares, so the obligation to move passes to the other side. It is the way to "lose a tempo" when there is no waiting move.
Play both sides and see the perfect result of every position and every move.
Use the arrow keys to move between squares. Enter or space selects a piece, then the destination square. Escape cancels.
Set up a valid position to query.
Pick an endgame to analyze with the tablebase or to practice against perfect play.
Basic mates and the 50-move rule
King and queen against king
Win
The simplest mate. Use the queen to corner the enemy king and bring your own king to help. With perfect play, mate comes in at most 10 moves. Beware of stalemate, which is a draw.
King and rook against king
Win
Cut the enemy king off with the rook and advance your king until it faces the enemy king, in opposition, to give check on the edge. With perfect play, mate comes in at most 16 moves.
50-move rule: a cursed win
Cursed win
King and rook against king, but with the counter at 85 plies. The mate needs more moves before a capture or pawn move than are left until the draw, and the tablebase marks the position as a cursed win. Reset the counter in Set up and compare.
King and pawn
King and pawn: key squares
Win
When your king reaches a key square in front of the pawn, promotion is guaranteed even if the opponent moves first. Here the white king on e6 stands in front of the pawn on e5. Switch the side to move in Set up and see it wins both ways.
King and pawn: opposition
Win for the side not to move
Kings face to face with one square between: whoever has to move gives ground. With Black to move White wins; with White to move it is a draw (switch the side to move in Set up and check). Triangulation is the maneuver of losing a tempo with the king to hand the obligation to move to the opponent.
Rook pawn: a draw
Draw
With the pawn on the a or h file, the enemy king reaches the promotion corner and has no squares to attack, which draws (or stalemates). In practice, defend as Black.
Rook endgames
Lucena position
Win
The most famous rook endgame: pawn on the 7th rank and your king in front of it, cut off by the enemy rook. The technique is building a bridge: take the rook to the 4th rank and use it as a shield against the checks, so the king can step out and promote.
Philidor position
Draw
The classic drawing defense: the rook stays on the defender's 3rd rank (here a6) and stops the enemy king from advancing. When the pawn advances, the rook goes back and checks from behind. In practice, defend as Black.
Bishops and knights
Two bishops against king
Win
Bishops of opposite colors together push the king to a corner, with your king's help. It always wins, in at most 19 moves with perfect play.
Bishop and knight against king
Win
The hardest of the basic mates: the king can only be mated in the corner of the bishop's color, and the way there is long (up to 33 moves). Practicing against the tablebase shows the technique.
Wrong bishop and rook pawn
Draw
The dark-squared bishop does not control a8, which is light, so the king in the corner draws even with a bishop and a pawn up. With the right-colored bishop it would be a win.
Data: the Lichess Syzygy tablebase (tablebase.lichess.org), by Ronald de Man, with the 7-piece tables generated by Bojun Guo. Cburnett pieces by Colin M. L. Burnett (Wikimedia Commons), under the BSD license.