Play and practice

Endgame tablebases: exact answers for endgames

For iPhone, iPad and Mac. No account.

White to moveDraw
White to moveWhite wins

With few pieces left on the board, chess becomes a solved game. Endgame tablebases contain the exact result of every possible position with a small number of pieces: won, drawn or lost, with best play from both sides. ChessWOW can download the Syzygy tablebases to your device, so Stockfish plays and judges these endgames without guessing. This page explains how tablebases work and how to use them to learn endgames.

What a tablebase is

A chess engine searches ahead and estimates. A tablebase does not estimate; it looks the position up. Tablebases are built backwards from every possible checkmate, step by step, until every position with a given set of pieces has a known result. The Syzygy tablebases by Ronald de Man are the format most engines use today. The piece count includes the kings: king and pawn against king is a three-piece endgame, king, rook and pawn against king and rook has five pieces.

Win, draw, loss and DTZ

For each position, the tablebase answers two questions:

  • WDL (win, draw, loss): what the result is with perfect play.
  • DTZ (distance to zeroing): how many moves it takes until the next capture or pawn move on the way to the win. This matters because of the fifty-move rule. A win that needs more than fifty moves without a capture or pawn move is not a win in a real game, and Syzygy takes this into account.

In practice, the engine stops estimating as soon as a position is in the tablebase and shows the exact result.

Example 1: the opposition decides

White: king e4, pawn e3. Black: king e6. Everything depends on who is to move.

  • White to move: draw. Whatever White does, Black can keep the kings facing each other and block the pawn.
  • Black to move: White wins. Black must step aside, and the white king advances in front of its pawn.

This idea, the opposition, decides a large share of king and pawn endgames. Set the position up in the board editor, switch the side to move and play both versions against Stockfish. With the tablebase installed, Stockfish defends perfectly, so you notice every inaccuracy.

White to moveDraw
Black to moveWhite wins

Example 2: the Lucena position

White: king d8, pawn d7, rook e1. Black: king f7, rook c2. White to move wins, but only with the right technique. The classic method is called "building a bridge":

  1. Rf1+ drives the black king away from the f-file.
  2. Rf4 places the rook on the fourth rank, ready to block checks later.
  3. The white king walks out (Ke7, Kd6, Ke6, Kd5), and when the checks run out, Rd4 blocks the last one. The pawn promotes.

A typical mistake: interposing the rook on the e-file too early, while the black rook is still far enough away, throws the win away. Rook endgames like this have five pieces, so you need the optional five-piece tablebase to have Stockfish confirm each step exactly.

1. Rf1+White wins

Tablebases in ChessWOW

Open the settings and go to "Endgame database". Two sets are available:

  • Up to 4 pieces: about 1 MB. Covers all king and pawn endgames with one pawn, basic mates and many short endgames.
  • 5 pieces: about 1 GB. Adds rook and pawn against rook (Lucena and Philidor), rook and bishop against rook and many more. Use Wi-Fi for this download. You can cancel it, and it continues where it stopped.

The files come from the Lichess tablebase server, and only when you ask for them. Once installed, Stockfish uses them offline in analysis and when it plays against you.

How to practise endgames with an engine

  1. Step 1

    Pick a textbook endgame: the opposition, Lucena, Philidor's drawing defence, or mating with king and rook.

  2. Step 2

    Set it up and play it against the Grandmaster level of Stockfish. With a tablebase, the engine defends perfectly.

  3. Step 3

    When you fail, open the analysis, see where the result changed from win to draw, and play the position again.

  4. Step 4

    Repeat until you win it reliably from both sides of the board.

Good to know

Questions and answers

What is an endgame tablebase?

A database with the exact result of every position with a small number of pieces. Engines use it to play and judge those endgames perfectly.

Do kings count as pieces?

Yes. King and pawn against king is a three-piece endgame.

How large are the tablebases in ChessWOW?

Up to four pieces about 1 MB, the optional five-piece set about 1 GB.

Do I need the internet to use them?

Only for the download. After that, Stockfish uses them offline.

What does DTZ mean?

Distance to zeroing: the number of moves until the next capture or pawn move with best play. It makes sure a win also respects the fifty-move rule.

Are six- or seven-piece tablebases available?

No. ChessWOW offers up to five pieces. Larger sets need many gigabytes or terabytes and are meant for computers with large storage.

More guides

Continue with

ChessWOW

Learn the endgames that decide games.

Syzygy tablebases on iPhone, iPad and Mac, offline after one download.

Download free