What a tablebase is
An engine like Stockfish calculates: it looks ahead from the current position and estimates. A tablebase doesn’t calculate anything during the game. It is a lookup table, built in advance, that already contains the answer for every position with a given set of pieces.
It is built backwards, a process called retrograde analysis. First every checkmate is marked as lost for the side to move. Then every position where some move reaches one of those is a win in 1, every position where all moves lead to a win in 1 for the opponent is a loss in 1, and so on, until nothing changes. Whatever is left is a draw. Because every position is covered, the result is exact.
How big they are
Each extra piece multiplies the number of positions by about a hundred, so the size grows very fast:
| Pieces | Positions | Tablebase | Size |
|---|---|---|---|
| 5 pieces | 26,038,209,193 | Syzygy (2013) | 939 MB |
| 6 pieces | 3,787,154,440,416 | Syzygy (2013) | 150.2 GB |
| 7 pieces | 423,836,835,667,331 | Syzygy (2018) | 18.4 TB |
| 7 pieces | — | Lomonosov, DTM (2012) | about 140 TB |
Source: Wikipedia, Endgame tablebase; 7-piece position count from the Lichess announcement. Syzygy, by Ronald de Man and Bojun Guo, is the format most engines support today.
DTZ vs DTM
Tablebases differ in what they count:
- DTM, depth to mate: the number of moves to checkmate with best play. This is what most people expect, and it is what the older Nalimov and Lomonosov tables store.
- DTZ, depth to zeroing: the number of moves to the next capture or pawn move, which resets the 50-move counter. Syzygy uses this, because it guarantees that a won position is won within the 50-move rule whenever that is possible.
The practical difference: a DTZ tablebase sometimes plays a slower mate than the fastest one, because it aims for the next safe capture or pawn move instead. It never turns a win into a draw. Lichess explains this choice in its 7-piece announcement.
We solved three endgames ourselves
To show how this works, we wrote a small retrograde solver and built exact distance-to-mate tables for the three most basic endgames. It took about one second. (Our king and pawn lesson uses the same full solve, broken down file by file.)
| Endgame | Positions, White to move | Won, White to move | Won, Black to move | Longest win |
|---|---|---|---|---|
| King + queen vs king | 144,508 | 100.0% | 89.7% | mate in 10 |
| King + rook vs king | 175,168 | 100.0% | 90.1% | mate in 16 |
| King + pawn vs king | 163,328 | 76.5% | 58.1% | mate in 28 |
Two checks show the tables are right. King and queen against king always wins with White to move and never needs more than 10 moves; king and rook against king never needs more than 16. Those are the long-established figures, and our tables reproduce both exactly. The new number is the pawn ending: with White to move, 76.5% of positions are wins, and the longest takes 28 moves (promotion included).
Then we gave the two longest positions to Stockfish 17.1 without a tablebase and let it search to depth 30 and 34:
| Position | Tablebase | Stockfish, no tablebase |
|---|---|---|
| King + queen vs king, longest position | mate in 10 | mate in 13 |
| King + rook vs king, longest position | mate in 16 | mate in 22 |
Stockfish wins both, of course, but it finds a slower mate: 3 moves too many with the queen, 6 with the rook. In a game that hardly matters. In a long endgame near the 50-move limit it can, which is why top engines play with tablebases attached.
Three positions people misjudge
All three come from our king and pawn table, and all three look like easy wins for White.
Stockfish agrees with all three, scoring the White-to-move positions 0.00 at depth 30. The rules behind them are in our guides to the king and pawn endgame and endgame practice.
Using tablebases in analysis
- Online: Lichess shows 7-piece Syzygy results in its analysis board for free. Our analysis board runs Stockfish without tablebase files, which is fine for most endgames but can give a slower mate or a cautious score in long ones.
- On your computer: download Syzygy files and point the engine at them with the
SyzygyPathoption. The 3–5-piece set is under 1 GB; 6 pieces need about 150 GB. - For study: set up an endgame, look up the result, then try to win (or hold) it against the engine. The board editor is the quickest way to set up positions like the three above.
Famous tablebase discoveries
- Queen against rook can take over 30 moves. The longest four-piece win, king and queen against king and rook, needs more than 30 moves with perfect defence (ChessBase).
- Mate in 549. The Lomonosov tables, built on a supercomputer in 2012, revealed a seven-piece position that is mate in 549 moves, ignoring the 50-move rule (Wikipedia).
- 584 moves with eight pieces. As of January 2023, the longest known forced win in the partial eight-piece tables was 584 moves.
- Free for everyone. In 2018 Bojun Guo and Ronald de Man finished the 7-piece Syzygy tables after five months of computing and shared them openly; Lichess put them online the same year.
These very long wins are why the 50-move rule matters, and why DTZ tablebases exist. See how many possible chess games there are for why the whole game will never fit in a table.
FAQ
What is a chess endgame tablebase?
A database that stores the exact result (win, draw or loss) of every legal position with a small number of pieces, along with the best move. It is built backwards from every checkmate, so it is never wrong. Complete tablebases exist for all positions with up to 7 pieces, including the two kings.
Does Stockfish use a tablebase?
Only if you give it one. Stockfish can probe Syzygy tablebase files on your disk during its search, and the big engine tournaments run it that way. The Stockfish that runs in a web browser, including on our analysis board, has no tablebase files, so in endgames it relies on search alone.
How big is the 7-piece tablebase?
The Syzygy 7-piece set covers 423,836,835,667,331 unique positions and takes about 18.4 TB. The older Lomonosov 7-piece tables, which store distance to mate, took about 140 TB.
What is the difference between DTZ and DTM?
DTM (depth to mate) counts the moves to checkmate. DTZ (depth to zeroing) counts the moves to the next capture or pawn move, which resets the 50-move counter. Syzygy tablebases use DTZ, so they always win within the 50-move rule when that is possible, but not always by the fastest mate.
Is there an 8-piece tablebase?
Not a complete one. Some 8-piece tables have been generated, and as of January 2023 the longest known forced win with eight pieces was 584 moves.
Can I use a tablebase for free?
Yes. Lichess offers free 7-piece Syzygy lookups in its analysis board. For a desktop engine you can download the files yourself, but the full 7-piece set needs about 18 TB of disk space; the 5-piece set fits in under 1 GB.
Has chess been solved by tablebases?
No. Tablebases solve endgames with up to 7 pieces. The full game starts with 32, and the number of positions is far too large to store. See how many possible chess games there are.
How we built ours
Our solver (about 120 lines of C++) enumerates every placement of the two kings and the extra piece with either side to move, marks illegal positions, checkmates and stalemates, and then repeats backward passes one ply at a time until no position changes. Pawn promotions look up the queen and rook tables. It counts positions with distinct squares, so mirror images are counted separately, and it stores exact distance to mate; it ignores the 50-move rule, which never matters in these three endgames. Stockfish comparisons use Stockfish 17.1 (WebAssembly, 1 thread, 64 MB hash, no tablebases) on November 25, 2026. Facts about published tablebases are from the sources linked in each section.