ChessMess Play free

Home › Chess history › Chess and computers

Chess and computers: from the Mechanical Turk to Stockfish

The story of chess machines: the Mechanical Turk hoax, Turing and Shannon, Deep Blue beating Kasparov, tablebases, Stockfish, AlphaZero, and why chess isn't solved.

Copper engraving of the Mechanical Turk, a chess-playing figure on a cabinet with its doors open to show gears inside
Copper engraving of the Mechanical Turk, a chess-playing figure on a cabinet with its doors open to show gears inside. Wolfgang von Kempelen (drawing), engraved by P. G. Pintz, about 1783 · Public domain · source

People have dreamed of chess-playing machines for more than 250 years. The first famous one, the Mechanical Turk of 1770, was a trick with a human hidden inside. Real computer chess began on paper with Alan Turing and Claude Shannon around 1950, beat the world champion in 1997, and today a free program on a phone plays far better than any human. Even so, chess is not "solved": nobody knows for certain whether perfect play would win for White or end in a draw.

The Mechanical Turk: a brilliant hoax

In 1770 the inventor Wolfgang von Kempelen showed Empress Maria Theresa of Austria a life-sized figure dressed as an Ottoman Turk, sitting behind a wooden cabinet with a chessboard on top. Before each game Kempelen opened the cabinet doors to show the gears and wheels inside (the engraving above). Then the Turk played, and it usually won.

For 84 years the Turk toured Europe and America. In 1783 it visited the Café de la Régence in Paris, the coffeehouse at the centre of French chess (see chess from coffeehouses to world championships), and played the great Philidor, who beat it. It also played Benjamin Franklin and, in 1809, Napoleon.

It was all a trick. A strong player sat hidden inside the cabinet, shifting position while the doors were opened, and moved the Turk's arm with levers. The machine was destroyed by a fire in Philadelphia in 1854, and a full explanation of the secret was published in 1857.

El Ajedrecista: the first real chess machine

The first machine that truly played chess by itself was built in Spain. The engineer Leonardo Torres Quevedo finished El Ajedrecista ("The Chess Player") in 1912 and showed it in public in 1913, and in Paris in 1914. It played only one endgame, its king and rook against a human's lone king, but it chose its own moves using electrical contacts under the board and always delivered checkmate in the end. Both versions still work and are kept in a museum in Madrid.

Turing's paper machine

In 1948 the British mathematician Alan Turing and his colleague David Champernowne wrote down a set of rules that a computer could follow to choose a chess move. They called it Turochamp. No computer of the time could run it, so in 1952 Turing played a game against the computer scientist Alick Glennie by working out every move of the program by hand, sometimes taking half an hour per move. The "paper machine" lost in 29 moves, but it was a complete game played by an algorithm, a list of exact instructions.

Shannon's big number

In 1950 the American engineer Claude Shannon published "Programming a Computer for Playing Chess", the paper that started computer chess as a science. It explains why a computer cannot simply check everything.

Think of chess as a tree. From the starting position a branch grows for every possible move, then from each of those a branch for every reply, and so on. This is called the game tree. Shannon estimated about 1,000 possibilities for each pair of moves (one by White and one by Black) and a typical game of about 40 such pairs. Multiply 1,000 by itself 40 times and you get about 10¹²⁰ possible games: a 1 followed by 120 zeros. This is now called the Shannon number. For comparison, the whole observable universe is usually estimated to hold about 10⁸⁰ atoms.

Counting positions instead of games gives a smaller but still enormous number. A modern estimate by John Tromp and Peter Österlund, made by testing large random samples of positions with a computer, puts the number of legal chess positions at about 4.8 × 10⁴⁴. Shannon worked out that a machine checking one final position every millionth of a second would need around 10⁹⁰ years to choose its first move by brute force. So he suggested two smarter ways: look at every move but only a few turns ahead, or look only at sensible moves but much deeper.

Deep Blue beats the world champion

Computers became faster every year, and so did chess programs. In 1996 the world champion Garry Kasparov beat IBM's supercomputer Deep Blue 4–2 in Philadelphia, even though he lost the first game. In May 1997, in a rematch in New York, an upgraded Deep Blue won 3½–2½. It was the first time a reigning world champion lost a match to a computer under tournament conditions. The whole story is on our page about Deep Blue vs Kasparov. By 2006 programs running on ordinary desktop computers had caught up: that year Deep Fritz beat world champion Vladimir Kramnik 4–2, and serious matches between top humans and computers soon stopped.

Endgame tablebases: perfect play with few pieces

An endgame tablebase is a huge table that stores the perfect result, and the best move, for every position with a small number of pieces. It is built backwards: the computer starts from every possible checkmate and works out which positions lead to it. Ken Thompson built early tablebases in the 1970s and 1980s. All positions with up to six pieces (counting both kings) were done by 2005. Seven-piece positions were almost complete in 2012 and fully complete in 2018.

For these positions chess really is solved. Some of the answers are stranger than any human could imagine: one seven-piece position needs 549 moves to force checkmate. Work on eight-piece tables is still going on.

Stockfish and neural networks

For decades, engines (chess-playing programs) judged positions with rules written by programmers: count the material, reward a safe king, punish weak pawns. The strongest of these became Stockfish, a free, open-source engine first released in 2008 by Tord Romstad, Marco Costalba and Joona Kiiski. Since 2013 volunteers have lent their computers' spare time to test every proposed change.

In 2020 Stockfish added NNUE, a small neural network: a program that learns patterns from millions of example positions instead of following hand-written rules. The idea came from Yu Nasu, who invented it in 2018 for shogi (Japanese chess). Stockfish 12, released in September 2020, used it and became much stronger, and since July 2023 Stockfish judges positions with the neural network alone. Engine rating lists put Stockfish at about 3650 (CCRL, October 2026), while the highest FIDE rating any human has ever reached is 2882, by Magnus Carlsen. The two scales are not exactly the same, but the gap is enormous. You can read more in what is Stockfish?

AlphaZero and Leela: learning from zero

In December 2017 DeepMind, an artificial intelligence company owned by Google, announced AlphaZero. It was given only the rules of chess and learned everything else by playing against itself. After nine hours of training it played a 100-game match against Stockfish 8 and won 28 games, drew 72 and lost none. Critics said Stockfish had been given weak settings, so in a fuller paper published in December 2018 DeepMind reported a 1,000-game match under better conditions, which AlphaZero also won clearly, with 155 wins and 6 losses.

AlphaZero itself was never released to the public. So volunteers built an open version that learns the same way: Leela Chess Zero, announced in January 2018. Leela now plays at a level close to Stockfish.

Is chess solved?

No. "Solved" would mean we know the result of perfect play from the starting position, as we do for noughts and crosses (tic-tac-toe). Tablebases solve positions with up to seven pieces, but a game starts with 32. With about 4.8 × 10⁴⁴ legal positions, no computer can store or search them all. Checkers (draughts) was solved in 2007, yet it has only about the square root of chess's number of positions, and solving it took 16 years.

When top engines play each other from the normal starting position, most games end in draws (AlphaZero's first match against Stockfish had 72 draws in 100 games). That is one reason many people suspect perfect chess would be a draw, but nobody can prove it.

How engines changed chess

Engines changed how everyone trains. Grandmasters use them to prepare openings and check their ideas, and ordinary players can find their mistakes seconds after a game. ChessMess runs Stockfish 19 in your browser for free on the analysis board.

They also brought a new problem: cheating. Since 2014 FIDE's Laws of Chess have forbidden players to carry a phone or other electronic device in the playing area, and big events add scanners and delay their live broadcasts. Online sites run their own fair-play checks.

Sources

Checked in November 2026.

Questions and answers

Was the Mechanical Turk real?
No. The Turk, first shown in 1770, looked like a chess-playing machine, but a strong human player was hidden inside the cabinet and moved its arm with levers.
What is the Shannon number?
It is Claude Shannon's 1950 estimate of the number of possible chess games: about 10 to the power 120, which is a 1 followed by 120 zeros.
Is chess solved?
No. Computers have solved every position with up to seven pieces, but chess has about 4.8 × 10^44 legal positions, far too many to check. Nobody has proved whether perfect play wins for White or is a draw.
When did a computer first beat the world chess champion?
IBM's Deep Blue beat world champion Garry Kasparov 3½–2½ in a six-game match in New York in May 1997.
How strong is Stockfish?
Far stronger than any human. Engine rating lists put it at about 3650 in October 2026, while the highest FIDE rating a human has ever reached is 2882.

Play free now — no sign-up needed

Start playingInvite a friend

Keep reading

Who invented chess? How chaturanga began in IndiaChess began in India as chaturanga around the 6th century CE. What historians know, what they still argue about, and which famous stories are only legends.Chess in Persia and the Islamic world: chatrang and shatranjHow chess came from India to Persia as chatrang, became shatranj in the Islamic world, gave us the word checkmate and travelled on to Spain and Europe.Chess in medieval Europe: how the game arrived and changedHow chess reached Europe around the 10th century through Spain, Italy and Byzantium, won over kings and monks, and turned the vizier into a queen.Chess in India: from chaturanga to world championsIndia gave the world chess. The whole story: chaturanga, shatranj at Indian courts, Sultan Khan, Anand, Gukesh and India's 100 grandmasters.The birth of modern chess: the new queen, Lucena, Ruy López and GrecoHow chess became the modern game in Spain and Italy around 1475–1500: the new queen and bishop, the first printed chess books, Ruy López and Greco.