Stockfish is a
free and open-source
Free and open-source software (FOSS) is software available under a Software license, license that grants users the right to use, modify, and distribute the software modified or not to everyone free of charge. FOSS is an inclusive umbrella term ...
chess engine
In computer chess, a chess engine is a computer program that analyzes chess or List of chess variants, chess variant positions, and generates a move or list of moves that it regards as strongest.
A chess software engine, engine is usually a Front ...
, available for various desktop and mobile platforms. It can be used in
chess software
Chess is a board game for two players. It is an abstract strategy game that involves Perfect information, no hidden information and no elements of game of chance, chance. It is played on a square chessboard, board consisting of 64 squares arran ...
through the
Universal Chess Interface
The Universal Chess Interface (UCI) is an open communication protocol that enables chess engines to communicate with user interfaces.
History
In November 2000, the UCI protocol was released. Designed by Rudolf Huber and Stefan Meyer-Kahlen, the ...
.
Stockfish has been one of the strongest chess engines in the world for several years; it has won all main events of the
Top Chess Engine Championship
Top Chess Engine Championship, formerly known as Thoresen Chess Engines Competition (TCEC or nTCEC), is a computer chess tournament that has been run since 2010. It was organized, directed, and hosted by Martin Thoresen until the end of Season 6; f ...
(TCEC) and the
Chess.com Computer Chess Championship (CCC) since 2020 and, , is the strongest CPU chess engine in the world with an estimated
Elo
Elo or ELO may refer to:
Arts and entertainment
* Electric Light Orchestra, a British rock music group
** ''The Electric Light Orchestra'' (album), the group's debut album
* ''Elo'', a member magazine for the Tuglas Society
Biology
* Very-long-c ...
rating of 3644, in a time control of 40/15 (15 minutes to make 40 moves), according to CCRL.
The Stockfish engine was developed by Tord Romstad, Marco Costalba, and Joona Kiiski, and was derived from Glaurung, an open-source engine by Tord Romstad released in 2004. It is now being developed and maintained by the Stockfish community.
Stockfish historically used only a classical
hand-crafted function to evaluate board positions, but with the introduction of the
efficiently updatable neural network
In computer strategy games, for example in shogi and chess, an efficiently updatable neural network (NNUE, a Japanese wordplay on Nue, sometimes stylised as ƎUИИ) is a neural network-based evaluation function whose inputs are piece-square tabl ...
(NNUE) in August 2020, it adopted a hybrid evaluation system that primarily used the neural network and occasionally relied on the hand-crafted evaluation. In July 2023, Stockfish removed the hand-crafted evaluation and transitioned to a fully neural network-based approach.
Features
Stockfish uses a tree-search algorithm based on
alpha–beta search with several hand-designed heuristics, and since Stockfish 12 (2020) uses an efficiently updatable neural network as its evaluation function. It represents positions using
bitboard
A bitboard is a specialized bit array data structure commonly used in computer systems that play board games, where each bit corresponds to a game board space or piece. This allows parallel bitwise operations to set or query the game state, or d ...
s.
Stockfish supports
Chess960
Chess960, also known as Fischer Random Chess, is a chess variant that randomizes the starting position of the pieces on the back rank. It was introduced by former world chess champion Bobby Fischer in 1996 to reduce the emphasis on opening prepa ...
, a feature it inherited from Glaurung. Support for
Syzygy tablebases, previously available in a
fork
In cutlery or kitchenware, a fork (from 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tines with which one can spear foods either to h ...
maintained by Ronald de Man, was integrated into Stockfish in 2014. In 2018 support for the 7-man Syzygy was added, shortly after the tablebase was made available. Stockfish supports an unlimited number of
CPU threads in
multiprocessor
Multiprocessing (MP) is the use of two or more central processing units (CPUs) within a single computer system. The term also refers to the ability of a system to support more than one processor or the ability to allocate tasks between them. The ...
systems, with a maximum
transposition table
{{no footnotes, date=November 2017
A transposition table is a cache of previously seen positions, and associated evaluations, in a game tree generated by a computer game playing program. If a position recurs via a different sequence of moves, the ...
size of 32 TB.
Stockfish has been a very popular engine on various platforms. On desktop, it is the default chess engine bundled with the
Internet Chess Club
The Internet Chess Club (ICC) is a commercial Internet chess server devoted to the play and discussion of chess and chess variants. ICC had over 30,000 subscribing members in 2005. It was the first Internet chess server and was the largest p ...
interface programs BlitzIn and Dasher. On mobile, it has been bundled with the Stockfish app, SmallFish and Droidfish. Other Stockfish-compatible
graphical user interface
A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
s (GUIs) include
Fritz
Fritz is a common German language, German male name. The name originated as a German diminutive of Friedrich (given name), Friedrich or Frederick (given name), Frederick (''Der Alte Fritz'', and ''Stary Fryc'' were common nicknames for King Fred ...
, Arena, Stockfish for Mac, and
PyChess
''PyChess'' is a free software chess client developed for GNU. It allows users to play offline or online via the Free Internet Chess Server (FICS). PyChess also incorporates a built-in chess engine, which in contrast to most other chess AIs is ...
. Stockfish can be compiled to
WebAssembly
WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating communication between such programs and their host environment.
The main goal of ...
or
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
, allowing it to run in the browser. Both
Chess.com
Chess.com is an internet chess server and social networking website. One of the largest chess platforms in the world, the site operates on a freemium model in which some features are available for free, and others are available via subscription ...
and
Lichess
Lichess (; ) is a free and open-source software, free and open-source Internet chess server run by a Nonprofit organization, non-profit organization of the same name. Users of the site can play online chess anonymously and optionally register an ...
provide Stockfish in this form in addition to a server-side program.
Release versions and development versions are available as
C++
C++ (, pronounced "C plus plus" and sometimes abbreviated as CPP or CXX) is a high-level, general-purpose programming language created by Danish computer scientist Bjarne Stroustrup. First released in 1985 as an extension of the C programmin ...
source code
In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer.
Since a computer, at base, only ...
and as precompiled versions for
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
,
macOS
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
,
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
32-bit/64-bit and
Android
Android most commonly refers to:
*Android (robot), a humanoid robot or synthetic organism designed to imitate a human
* Android (operating system), a mobile operating system primarily developed by Google
* Android TV, a operating system developed ...
.
History
The program originated from ''Glaurung'', an open-source chess engine created by Tord Romstad and first released in 2004. Four years later, Marco Costalba forked the project, naming it ''
Stockfish
Stockfish is unsalted fish, especially cod, dried by cold air and wind on wooden racks (which are called "hjell" in Norway) on the foreshore. The drying of food is the world's oldest known preservation method, and dried fish has a storage li ...
'' because it was "produced in Norway and cooked in Italy" (Romstad is Norwegian and Costalba is Italian). The first version, Stockfish 1.0, was released in November 2008.
For a while, new ideas and code changes were transferred between the two programs in both directions, until Romstad decided to discontinue Glaurung in favor of Stockfish, which was the stronger engine at the time. The last Glaurung version (2.2) was released in December 2008.
Around 2011, Romstad decided to abandon his involvement with Stockfish in order to spend more time on his new iOS chess app. On 18 June 2014 Marco Costalba announced that he had "decided to step down as Stockfish maintainer" and asked that the community create a fork of the current version and continue its development. An official repository, managed by a volunteer group of core Stockfish developers, was created soon after and currently manages the development of the project.
Fishtest
Since 2013, Stockfish has been developed using a
distributed Distribution may refer to:
Mathematics
*Distribution (mathematics), generalized functions used to formulate solutions of partial differential equations
*Probability distribution, the probability of a particular value or value range of a varia ...
testing framework named ''Fishtest'', where volunteers can donate CPU time for testing improvements to the program.
Changes to game-playing code are accepted or rejected based on results of playing of tens of thousands of games on the framework against an older "reference" version of the program, using
sequential probability ratio test
The sequential probability ratio test (SPRT) is a specific Sequential analysis, sequential hypothesis test, developed by Abraham Wald and later proven to be optimal by Wald and Jacob Wolfowitz. Neyman–Pearson lemma, Neyman and Pearson's 1933 res ...
ing. Tests on the framework are verified using the
chi-squared test
A chi-squared test (also chi-square or test) is a Statistical hypothesis testing, statistical hypothesis test used in the analysis of contingency tables when the sample sizes are large. In simpler terms, this test is primarily used to examine w ...
, and only if the results are statistically significant are they deemed reliable and used to revise the software code.
After the inception of Fishtest, Stockfish experienced an explosive growth of 120
Elo points in just 12 months, propelling it to the top of all major rating lists.
, the framework has used a total of more than 18,300 years of CPU time to play over 9.2 billion chess games.
NNUE

In June 2020, Stockfish introduced the
efficiently updatable neural network
In computer strategy games, for example in shogi and chess, an efficiently updatable neural network (NNUE, a Japanese wordplay on Nue, sometimes stylised as ƎUИИ) is a neural network-based evaluation function whose inputs are piece-square tabl ...
(NNUE) approach, based on earlier work by
computer shogi
Computer shogi is a field of artificial intelligence concerned with the creation of computer programs which can play shogi. The research and development of shogi software has been carried out mainly by freelance programmers, university research gro ...
programmers. Instead of using manually designed heuristics to evaluate the board, this approach introduced a neural network trained on millions of positions which could be evaluated quickly on CPU. On 2 September 2020, the twelfth version of Stockfish was released, incorporating NNUE, and reportedly winning ten times more game pairs than it loses when matched against version eleven. In July 2023, the classical evaluation was completely removed in favor of the NNUE evaluation.
Competition results
Top Chess Engine Championship
Stockfish is a
TCEC
Top Chess Engine Championship, formerly known as Thoresen Chess Engines Competition (TCEC or nTCEC), is a computer chess tournament that has been run since 2010. It was organized, directed, and hosted by Martin Thoresen until the end of Season 6; f ...
multiple-time champion and the current leader in trophy count. Ever since TCEC restarted in 2013, Stockfish has finished first or second in every season except one. Stockfish finished second in TCEC Season 4 and 5, with scores of 23–25 first against
Houdini
Erik Weisz (March 24, 1874 – October 31, 1926), known professionally as Harry Houdini ( ), was a Hungarian-American escapologist, illusionist, and stunt performer noted for his escape acts.
Houdini first attracted notice in vaudeville in ...
3 and later against
Komodo 1142 in the Superfinal event. Season 5 was notable for the winning Komodo team as they accepted the award posthumously for the program's creator
Don Dailey
Don Dailey (March 10, 1956 – November 22, 2013) was an American researcher in computer chess and a game programmer. Along with collaborator Larry Kaufman, he was the author of the chess engine Komodo. Dailey started chess programming in t ...
, who succumbed to an illness during the final stage of the event. In his honor, the version of Stockfish that was released shortly after that season was named "Stockfish DD".
On 30 May 2014, Stockfish 170514 (a development version of Stockfish 5 with tablebase support) convincingly won TCEC Season 6, scoring 35.5–28.5 against Komodo 7x in the Superfinal.
Stockfish 5 was released the following day. In TCEC Season 7, Stockfish again made the Superfinal, but lost to Komodo with a score of 30.5–33.5.
In TCEC Season 8, despite losses on time caused by buggy code, Stockfish nevertheless qualified once more for the Superfinal, but lost 46.5–53.5 to Komodo.
In Season 9, Stockfish defeated Houdini 5 with a score of 54.5–45.5.
Stockfish finished third during season 10 of TCEC, the only season since 2013 in which Stockfish had failed to qualify for the superfinal. It did not lose a game but was still eliminated because it was unable to score enough wins against lower-rated engines. After this technical elimination, Stockfish went on a long winning streak, winning seasons 11 (59–41 against Houdini 6.03),
12 (60–40 against Komodo 12.1.1),
and 13 (55–45 against Komodo 2155.00)
convincingly. In
Season 14, Stockfish faced a new challenger in
Leela Chess Zero
Leela Chess Zero (abbreviated as LCZero, lc0) is a free, open-source chess engine and volunteer computing project based on Google's AlphaZero engine. It was spearheaded by Gary Linscott, a developer for the Stockfish chess engine, and adapted ...
, ekeing out a win by one point (50.5–49.5).
Its winning streak was finally ended in
Season 15
A season is a division of the year based on changes in weather, ecology, and the number of daylight hours in a given region. On Earth, seasons are the result of the axial parallelism of Earth's axial tilt, tilted orbit around the Sun. In temperat ...
, when Leela qualified again and won 53.5–46.5,
but Stockfish promptly won
Season 16
A season is a division of the year based on changes in weather, ecology, and the number of daylight hours in a given region. On Earth, seasons are the result of the axial parallelism of Earth's tilted orbit around the Sun. In temperate and polar ...
, defeating AllieStein 54.5–45.5, after Leela failed to qualify for the Superfinal.
In
Season 17
A season is a division of the year based on changes in weather, ecology, and the number of daylight hours in a given region. On Earth, seasons are the result of the axial parallelism of Earth's tilted orbit around the Sun. In temperate and polar ...
, Stockfish faced Leela again in the superfinal, losing 52.5–47.5. However, Stockfish has won every Superfinal since: beating Leela 53.5–46.5 in
Season 18
A season is a division of the year based on changes in weather, ecology, and the number of daylight hours in a given region. On Earth, seasons are the result of the axial parallelism of Earth's tilted orbit around the Sun. In temperate and polar ...
, 54.5–45.5 in
Season 19
A season is a division of the year based on changes in weather, ecology, and the number of daylight hours in a given region. On Earth, seasons are the result of the axial parallelism of Earth's tilted orbit around the Sun. In temperate and polar ...
, 53–47 in
Season 20
A season is a division of the year based on changes in weather, ecology, and the number of daylight hours in a given region. On Earth, seasons are the result of the axial parallelism of Earth's tilted orbit around the Sun. In temperate and polar ...
, and 56–44 in
Season 21
A season is a division of the year based on changes in weather, ecology, and the number of daylight hours in a given region. On Earth, seasons are the result of the axial parallelism of Earth's axial tilt, tilted orbit around the Sun. In temperat ...
.
In Season 22, Komodo Dragon beat out Leela to qualify for the Superfinal, losing to Stockfish by a large margin 59.5-40.5. Stockfish did not lose an opening pair in this match. Leela made the Superfinal in Seasons 23 and 24, but was crushed by Stockfish both times (58.5-41.5 and 58-42). In Season 25, Stockfish once again defeated Leela, but this time by a narrower margin of 52-48.
Stockfish also took part in the TCEC cup, winning the first edition, but was surprisingly upset by Houdini in the semifinals of the second edition.
Stockfish recovered to beat Komodo in the third-place playoff.
In the third edition, Stockfish made it to the finals, but was defeated by
Leela Chess Zero
Leela Chess Zero (abbreviated as LCZero, lc0) is a free, open-source chess engine and volunteer computing project based on Google's AlphaZero engine. It was spearheaded by Gary Linscott, a developer for the Stockfish chess engine, and adapted ...
after blundering in a 7-man
endgame tablebase
In chess, the endgame tablebase, or simply the tablebase, is a computerised database containing precalculated evaluations of chess endgame, endgame positions. Tablebases are used to analyse finished games, as well as by chess engines to evaluate ...
draw. It turned this result around in the fourth edition, defeating Leela in the final 4.5–3.5.
In TCEC Cup 6, Stockfish finished third after losing to AllieStein in the semifinals, the first time it had failed to make the finals. Since then, Stockfish has consistently won the tournament, with the exception of the 11th edition which Leela won 8.5-7.5.
Chess.com Computer Chess Championship
Ever since
Chess.com
Chess.com is an internet chess server and social networking website. One of the largest chess platforms in the world, the site operates on a freemium model in which some features are available for free, and others are available via subscription ...
hosted its first
Chess.com Computer Chess Championship in 2018, Stockfish has been the most successful engine. It dominated the earlier championships, winning six consecutive titles before finishing second in CCC7. Since then, its dominance has come under threat from the neural-network engines Leelenstein and
Leela Chess Zero
Leela Chess Zero (abbreviated as LCZero, lc0) is a free, open-source chess engine and volunteer computing project based on Google's AlphaZero engine. It was spearheaded by Gary Linscott, a developer for the Stockfish chess engine, and adapted ...
, but it has continued to perform well, reaching at least the superfinal in every edition up to CCC11. CCC12 had for the first time a knockout format, with seeding placing CCC11 finalists Stockfish and Leela in the same half. Leela eliminated Stockfish in the semi-finals. However, a post-tournament match against the loser of the final, Leelenstein, saw Stockfish winning in the same format as the main event. After finishing second again to Leela in CCC13, and an uncharacteristic fourth in CCC14, Stockfish went on a long winning streak, taking first place in every championship since.
Other matches
Stockfish 5 versus Nakamura
Stockfish's strength relative to the best human chess players was most apparent in a handicap match with grandmaster
Hikaru Nakamura
Christopher Hikaru Nakamura[Rybka
Rybka is a computer chess engine designed by International Master Vasik Rajlich. Around 2011, Rybka was one of the top-rated engines on chess engine rating lists and won many computer chess tournaments.
After Rybka won four consecutive Wor ...](_blank)
, and in the next two games, he received White with pawn
odds
In probability theory, odds provide a measure of the probability of a particular outcome. Odds are commonly used in gambling and statistics. For example for an event that is 40% probable, one could say that the odds are or
When gambling, o ...
but no assistance. Nakamura was the world's fifth highest rated human chess player at the time of the match, while Stockfish 5 was denied use of its opening book and endgame tablebase. Stockfish won each half of the match 1.5–0.5. Both of Stockfish's wins arose from positions in which Nakamura, as is typical for his playing style, pressed for a win instead of acquiescing to a draw.
Stockfish 8 versus AlphaZero
In December 2017, Stockfish 8 was used as a benchmark to test
Google
Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
division
DeepMind
DeepMind Technologies Limited, trading as Google DeepMind or simply DeepMind, is a British–American artificial intelligence research laboratory which serves as a subsidiary of Alphabet Inc. Founded in the UK in 2010, it was acquired by Go ...
's
AlphaZero
AlphaZero is a computer program developed by artificial intelligence research company DeepMind to master the games of chess, shogi and Go (game), go. This algorithm uses an approach similar to AlphaGo Zero.
On December 5, 2017, the DeepMind ...
, with Stockfish running on CPU and AlphaZero running on Google's proprietary
Tensor Processing Units. AlphaZero was trained through self-play for a total of nine hours, and reached Stockfish's level after just four.
In 100 games from the starting position, AlphaZero won 25 games as White, won 3 as Black, and drew the remaining 72, with 0 losses.
AlphaZero also played twelve 100-game matches against Stockfish starting from twelve popular openings for a final score of 290 wins, 886 draws and 24 losses, for a point score of 733:467.
AlphaZero's victory over Stockfish sparked a flurry of activity in the computer chess community, leading to a new open-source engine aimed at replicating AlphaZero, known as
Leela Chess Zero
Leela Chess Zero (abbreviated as LCZero, lc0) is a free, open-source chess engine and volunteer computing project based on Google's AlphaZero engine. It was spearheaded by Gary Linscott, a developer for the Stockfish chess engine, and adapted ...
. By January 2019, Leela was able to defeat the version of Stockfish that played AlphaZero (Stockfish 8) in a 100-game match. An updated version of Stockfish narrowly defeated Leela Chess Zero in the superfinal of the
14th TCEC season, 50.5–49.5 (+10 =81 −9),
but lost the Superfinal of the
next season to Leela 53.5–46.5 (+14 =79 -7).
The two engines remained close in strength for a while, but Stockfish has pulled away since the introduction of NNUE, winning every TCEC season since Season 18.
Derivatives
* YaneuraOu, a strong shogi engine and the origin of NNUE. Speaks USI, a variant of
UCI UCI most commonly refers to:
* University of California, Irvine, a public university in Irvine, California, United States
* Union Cycliste Internationale, the world governing body for the sport of cycling
UCI may also refer to:
* Uganda Cancer In ...
for shogi.
* Fairy Stockfish, a version modified to play
fairy chess
Fairy chess is the area of chess composition in which there are some changes to the rules of chess. It may involve changes to the board, pieces, or rules to express an idea or theme impossible in orthodox chess. An altered piece used in fairy ...
. Runs with regional variants (chess, shogi,
makruk
Makruk (; ; ), or Thai chess (; ; ), is a Strategy game, strategy board game that is descended from the 6th-century Indian game of chaturanga or a close relative thereof, and is therefore related to chess. It is part of the family of chess varian ...
, etc.) as well as other variants like
antichess.
*
Lichess
Lichess (; ) is a free and open-source software, free and open-source Internet chess server run by a Nonprofit organization, non-profit organization of the same name. Users of the site can play online chess anonymously and optionally register an ...
Stockfish, a version for playing variants without fairy pieces.
* Crystal, which seeks to address common issues with chess engines such as positional or tactical blindness due to over reductions or over pruning, draw blindness due to the
move horizon and displayed principal variation reliability.
* Brainfish, which contains a reduced version of Cerebellum, a chess opening library.
* BrainLearn, a derivative of Brainfish but with a persisted learning algorithm.
* ShashChess, a derivative with the goal to apply Alexander Shashin theory from the book ''Best Play: a New Method for Discovering the Strongest Move''.
* Pikafish, a free, open source, and strong UCI
Xiangqi
Xiangqi (; ), commonly known as Chinese chess or elephant chess, is a Strategy game, strategy board game for two players. It is the most popular board game in China. Xiangqi is in the same family of games as shogi, janggi, chess, Western ches ...
engine derived from Stockfish that analyzes xiangqi positions and computes the optimal moves.
*
Houdini
Erik Weisz (March 24, 1874 – October 31, 1926), known professionally as Harry Houdini ( ), was a Hungarian-American escapologist, illusionist, and stunt performer noted for his escape acts.
Houdini first attracted notice in vaudeville in ...
6, a Stockfish derivative that did not comply with the terms of the GPL license.
* Fat Fritz 2, a Stockfish derivative that did not comply with the terms of the GPL license.
Notes
References
Further reading
Interview with Tord Romstad (Norway), Joona Kiiski (Finland) and Marco Costalba (Italy) programmers of Stockfish
External links
*
*
WebAssembly port of StockfishDevelopment versions built for Linux and WindowsDevelopers forumStockfish Testing Framework
{{DEFAULTSORT:Stockfish (Chess)
2008 software
Chess engines
Free software programmed in C++
Distributed computing projects
Software using the GNU General Public License
Applied machine learning
Cross-platform free software
Free software for Linux
Free software for Windows
Free software for macOS
Free and open-source Android software
Volunteer computing projects