In chess, an endgame tablebase, or simply tablebase, is a computerised database containing precalculated evaluations of endgame positions. Tablebases are used by players and chess engines to analyze games and positions. Tablebases are typically exhaustive, covering every legal arrangement of a specific selection of pieces on the board, with both White and Black to move. For each position, the tablebase records the ultimate result of the game assuming perfect play from both sides (i.e. a win for White, a win for Black, or a draw), and the number of moves required to achieve that result. Because every move from a covered position results in another covered position, the tablebase acts as an oracle that always provides the optimal move.

Tablebases are generated by retrograde analysis, working backwards from checkmated positions. By 2005, tablebases for all positions having up to six pieces, including the two kings, had been created. By August 2012, tablebases had solved chess for almost every position with up to seven pieces, with certain subclasses omitted due to their assumed triviality; the first complete seven-piece tablebase was released in August 2018. , work is still underway to solve all eight-piece positions.

Tablebases have profoundly advanced the chess community's understanding of endgame theory. Some positions previously believed to be drawn were proven to be winnable; in some cases, tablebase analysis found a mate in more than five hundred moves, far beyond the ability of humans, and beyond the capability of a computer during play. This caused the fifty-move rule to be called into question, since many positions were discovered that were winning for one side but drawn during play because of this rule. Initially, some exceptions to the fifty-move rule were introduced, but when more extreme cases were later discovered, these exceptions were removed. Tablebases also facilitate the composition of endgame studies.

While endgame tablebases exist for other board games, such as checkers, Website of KingsRow about the creation of a tablebases for 8x8 and 10x10 checkers nine men's morris, and some chess variants, examples of long endings for Capablanca chess the term endgame tablebase is usually assumed to refer to chess tablebases.

Background

Physical limitations of computer hardware aside, in principle it is possible to solve any game under the condition that the complete state is known and there is no random chance. Strong solutions, i.e. algorithms that can produce perfect play from any position, are known for some simple games such as Tic Tac Toe/Noughts and crosses (draw with perfect play) and Connect Four (first player wins). Weak solutions exist for somewhat more complex games, such as checkers (with perfect play on both sides the game is known to be a draw, but it is not known for every position created by less-than-perfect play what the perfect next move would be). Other games, such as chess and Go, have not been solved because their game complexity is far too vast for computers to evaluate all possible positions. To reduce the game complexity, researchers have modified these complex games by reducing the size of the board, or the number of pieces, or both.

Computer chess is one of the oldest domains of artificial intelligence, having begun in the early 1930s. Claude Shannon proposed formal criteria for evaluating chess moves in 1949. In 1951, Alan Turing designed a primitive chess-playing program, which assigned values for material and mobility; the program "played" chess based on Turing's manual calculations.Levy & Newborn, pp. 25-38 However, even as competent chess programs began to develop, they exhibited a glaring weakness in playing the endgame. Programmers added specific heuristics for the endgame – for example, the king should move to the center of the board.Levy & Newborn, pp. 129-30 However, a more comprehensive solution was needed.

In 1965, Richard Bellman proposed the creation of a database to solve chess and checkers endgames using retrograde analysis.Stiller, p. 84 Instead of analyzing forward from the position currently on the board, the database would analyze backward from positions where one player was checkmated or stalemated. Thus, a chess computer would no longer need to analyze endgame positions during the game because they would have been solved beforehand. It would no longer make mistakes because the tablebase always yielded the best possible move.

In 1970, Thomas Ströhlein published a doctoral thesisSee also with analysis of the following classes of endgame: , , , , , and . In 1977, Ken Thompson's KQKR tablebase was used in a match against Grandmaster Walter Browne.

Thompson and others helped extend tablebases to cover all four- and five-piece endgames, including , , and .Levy & Newborn, p. 144See also:

Lewis Stiller published a thesis with research on some six-piece tablebase endgames in 1991.Stiller, pp. 68-113

More recent contributors include: John Nunn, foremost data miner of chess endgames and prolific endgame author. Eugene Nalimov, after whom the popular Nalimov tablebases are named. Their total size is about 1.2 TB. Eiko Bleicher, who has adapted the tablebase concept to a program called "Freezer" Guy Haworth, an academic at the University of Reading, who has published extensively in the ICGA Journal and elsewhere; Marc Bourzutschky and Yakov Konoval, who have collaborated to analyze endgames with seven pieces on the board; Peter Karrer, who constructed a specialized seven-piece tablebase () for the endgame of the Kasparov versus The World online match; Vladimir Makhnychev and Victor Zakharov from Moscow State University, who completed the 4+3 DTM tablebases (525 endings including KPPPKPP) in July 2012 and the 5+2 DTM-tablebases (350 endings including KPPPPKP) in August 2012. They were generated on a supercomputer named Lomonosov. Their total size is about 140 TB. They were attacked by a ransomware in 2021, and have been offline since then.Forum post discussing the ransomware attack Ronald de Man and Bojun Guo, who generated the seven-man DTZ tablebase called the Syzygy tablebase in 2018. They were able to reduce the size of seven-man tablebases from 140 TB to 18.4 TB. Marc Bourzutschky and Niklas Fiekas collaborated in 2025 to create and host a partial eight-piece tablebase of positions with at least one pair of opposing pawns (referred to as op1) for Lichess, which its analysis tool now utilizes. The tablebase contains about 1.3% of all possible eight-piece positions, though based on various databases of human and computer chess games, Lichess estimated that it contains about half of all eight-piece endings reached in practical games. Its evaluations are of the positions' depth to conversion. Markus Böck, who in 2025 created Prophet TB, a 6-man DTM tablebase named in memory of Daniel "The Prophet" Naroditsky. Lichess quickly adopted Prophet TB as its source for DTM info.

The tablebases of all endgames with up to seven pieces are available for free download, and may also be queried using web interfaces. Research on creating an eight-piece tablebase started in 2021. During an interview with Google in 2010, Garry Kasparov said that "maybe" the limit will be eight pieces. Because the starting position of chess is the ultimate endgame, with 32 pieces, he claimed that chess can not be solved by computers. +Current status of endgame tablebases Number of pieces Number of positions Database name MetricCompleted in Size 3 368,079 Gaviota DTM 2008 51.5 KB Syzygy DTZ 2013 25.8 KB Prophet DTM 2026 49.9 KB 4 125,246,598 Gaviota DTM 2008 27.3 MB Syzygy DTZ 2013 4.3 MB Prophet DTM 2026 25.9 MB 5 25,912,594,054 Gaviota DTM 2008 7.0 GB Syzygy DTZ 2013 979.6 MB Prophet DTM 2026 7.1 GB 5 or fewer 26,038,209,193 Nalimov DTM 2005 7.05 GB 6 3,787,154,440,416 Syzygy DTZ2013 160.2 GB Nalimov DTM2005 1.2 TB Prophet DTM2026 1.2 TB 7 423,836,835,667,331 Syzygy DTZ2018 18.4 TB Lomonosov DTM2012 140 TB 8 (partial) ~500,000,000,000,000 Op1 (Lichess) DTC 2025 68.8 TB 8 38,176,306,877,748,245 ~2 PB (estimated for Syzygy)

Generating tablebases

The most basic info a tablebase can provide is whether a position is won, drawn, or lost, WDL. In addition, 50-move-aware TBs (such as Syzygy) also mark "cursed wins" and "blessed losses", for a five-way outcome distinction. Finally, tablebases can also provide various metrics for how far away a given win or loss is.

Metrics There are three conventional metrics for winning (or losing) moves; any particular tablebase format may choose to store one or multiple of them: Depth to mate (DTM) – The number of moves to checkmate Depth to conversion (DTC) – The number of moves to checkmate, a winning capture, or a winning promotion Depth to zeroing (DTZ) – The number of moves to conversion or to a winning pawn move DTZ determines the distance to a "zeroing-move" (i.e. a move which resets the move count to zero under the fifty-move rule), and is the metric conventionally used to apply that rule. By definition, all "won" positions will always have DTZ DTC DTM. In pawnless positions or positions with only blocked pawns, DTZ is identical to DTC.

Metric Play Moves before conversion Moves before mate DTC 1. Qxd1 Kc8 2. Qd2 Kb8 3. Qd8# 1 3 DTM 1. Qc7+ Ka8 2. Qa7# 2 2

DTC and DTZ evaluations may advocate for DTM-suboptimal lines. In the position to the right, the lowest DTC move takes one move longer to produce checkmate than the lowest DTM move; Qxd1 capturing the rook for the lowest DTC is a waste of a turn, as the optimal DTM move Qc7+ checks the king with mate right after, preventing the black rook from delaying.

This difference is typical of many endgames. DTC is always smaller than or equal to DTM, but the DTM metric always leads to the quickest checkmate. Incidentally, DTC = DTM in the unusual endgame of two knights versus one pawn because capturing the pawn (the only material Black has) results in a draw, unless the capture is also checkmate. Each of these metrics has a counterpart moderated by the fifty-move rule – DTC50, DTZ50 and DTM50 – in which a win that cannot be forced within the rule's allowance is scored as a draw. A moderated depth is not a property of the position alone: it also depends on the ply-count pc, the number of ply already played since the last capture or pawn move. As pc rises the depth can grow until the win becomes "frustrated" and turns into a fifty-move draw; even a mate in two ply is frustrated once 99 ply have been spent. DTM50 tables giving a depth for every value of pc were first computed for sub-6-man chess by Galen Huntington, and published with Guy Haworth in 2015.

Endgames of fewer than five men are unaffected, as their maximum DTM is below 100 ply. Among five-man endgames the rule bites hardest in KBBKN and KNNKP, and therefore also in the six-man endgames upstream of them, KBBKNN, KNNKNP and KNNKPP. Moderation does not simply shorten wins: compared with the unrestricted maximum DTM for the same material, the longest DTM50 win is shorter in some endgames – KBBKN, KNNKP, KRBKR and KQRKP among them – but longer in others, such as KPPKP, KPPKQ and KQPKQ. Since maximum DTZ exceeds 80, 240 and 510 moves in sub-6-man, sub-7-man and sub-8-man chess respectively, the fifty-move rule, now backed by the mandatory seventy-five-move rule, can be expected to frustrate more wins as men are added.

Step 1: Generating all possible positions

Once a metric is chosen, the first step is to generate all the positions with a given material. For example, to generate a DTM tablebase for the endgame of king and queen versus king (KQK), the computer must describe approximately 40,000 unique legal positions.