16 Free and Open-source Chess Engines
Chess is a strategic board game played between two players, aiming to checkmate the opponent's king. Each player starts with 16 pieces: one king, one queen, two rooks, two knights, two bishops, and eight pawns. The game is renowned for its deep tactical and strategic complexity.
Playing chess on computers has surged in popularity, with platforms like Chess.com and Lichess hosting millions of games daily. Statistics show that there are over 600 million active chess players worldwide, with online platforms attracting millions of users. Chess.com alone has over 70 million members. Studies reveal that regular chess players tend to have higher grades in school, showcasing improved cognitive and problem-solving skills.
What is a Chess Engine?
A chess engine is a software program designed to play chess at a high level, analyzing positions and calculating the best possible moves.
These engines use algorithms and vast databases of opening moves, endgames, and positions to evaluate and determine optimal strategies, often surpassing human capabilities.
They are integral tools for players seeking to improve their game, providing insights, move recommendations, and post-game analysis.
Open-source Chess Engines!
Open-source chess engines are freely available for anyone to use, modify, and distribute. They foster community collaboration, allowing enthusiasts and developers to contribute to their improvement. Notable examples include Stockfish and Lc0 (Leela Chess Zero), which are renowned for their strength and continuous development.
These engines are widely used in online platforms, tournaments, and research, offering transparency and innovation in the chess world.
What is a Universal Chess Interface (UCI)?
The Universal Chess Interface (UCI) is a standard protocol used to communicate with a chess engine, and is the recommended way to do so for typical graphical user interfaces (GUI) or chess tools. Alexandria implements the majority of its options as described in the UCI protocol.
1. ChessCoach
ChessCoach is a neural network-based chess engine capable of natural-language commentary. It plays chess with a rating of approximately 3450 Elo, which means it should usually beat even the strongest human players at 2850 Elo, and many other engines, but will often lose to the strongest, such as Stockfish 14 at 3550 Elo.
As with all engines, ChessCoach relies on examining millions of chess positions to decide on the best move to play. It uses a large, slow neural network just like AlphaZero or Leela Chess Zero (Lc0) to evaluate each position, unlike classical engines which aim for speed with a much simpler evaluation, or more recent NNUE engines, which are a stronger hybrid of both styles.
The neural network at the core of the engine is trained by playing against itself, using a feedback cycle to start from almost zero knowledge – just the rules of chess – and learn new ways to beat itself as it grows stronger.
Stronger neural network evaluations let it search better, and stronger search results let it train its neural network evaluation more effectively.
ChessCoach can also feed its chess knowledge into an additional neural network to comment on moves and positions in English. It is not very insightful and often wrong but shows some promise for the limited data it has been able to train on.
2. Alexandria (C++)
The Universal Chess Interface (UCI) is a standard protocol used to communicate with a chess engine, and is the recommended way to do so for typical graphical user interfaces (GUI) or chess tools. Alexandria implements the majority of its options as described in the UCI protocol.
3. Sunfish (Python)
Sunfish is a simple, but strong chess engine, written in Python. With its simple UCI interface, and removing comments and whitespace, it takes up just 131 lines of code! (build/clean.sh sunfish.py | wc -l
). Yet it plays at ratings above 2000 at Lichess.
Because Sunfish is small and strives to be simple, the code provides a great platform for experimenting.
People have used it for testing parallel search algorithms, experimenting with evaluation functions, and developing deep learning chess programs.
4. Avalanche (Zig)
Avalanche is the first and strongest chess engine written in the Zig programming language, proving Zig's ability to succeed in real-world, competitive applications.
5. Berserk Chess Engine (C)
UCI Chess Engine written in C.
6. Stockfish
Stockfish is a free and strong UCI chess engine derived from Glaurung 2.1 that analyzes chess positions and computes the optimal moves.
Stockfish does not include a graphical user interface (GUI) that is required to display a chessboard and to make it easy to input moves. These GUIs are developed independently from Stockfish and are available online.
7. Java Chess Engine (UCI compatible)
Bagatur chess engine is one of the strongest Java chess engines in the world. It runs on Android as well as on "desktop" Computers
8. Clover (C++)
Clover is a chess engine, written in C++, inspired by my favorite plant. Since the 2020 lockdown, I got bored and decided to combine the 2 things I love the most: chess and programing, into making a program that can beat me.
9. Caissa Chess Engine (C++)
Caissa Chess Engine is an open-source free strong, UCI command-line chess engine, written from scratch in C++ in development since early 2021. It is optimized for regular chess, FRC (Fischer Random Chess) and DFRC (Double Fischer Random Chess).
10. Mister Queen (C)
Mr. Queen is a chess engine written in C.
Features
- Bitboards and "magic" bitboards for board representation and super-fast move generation.
- Custom, hash-based opening book based on over three million games from the FICS database.
- Zobrist hashing and a transposition table storing exact values and the best move.
- Null move pruning, aspiration windows, iterative deepening, quiescence search.
- Supports the Universal Chess Interface (UCI).
- Passes all perft tests.
Limitations
Despite its amazing features list, it still comes with some limitations that include:
- Unaware of draw by repetition.
- Basic evaluation includes only material and piece-square values.
11. CrazyAra
CrazyAra is an open-source A Deep Learning UCI-Chess Variant Engine written in C++ & Python 🦜
12. Andoma
♟️ A chess engine with alpha-beta pruning, piece-square tables, move ordering, and command-line UI.
13. Pleco (Rust)
Pleco is a chess Engine & Library derived from Stockfish, written entirely in Rust.
14. Chess AI
A chess engine by someone who doesn't know how to play chess.
15. Koivisto UCI (C++)
Koivisto is a strong chess engine written primarily by Kim Kåhre and Finn Eggers in C++. Koivisto in itself is not a complete chess program and requires a UCI-compatible graphical user interface.
16. Walleye
Walleye is a UCI-compatible chess engine written using the classic alpha-beta style AI.