Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A chess engine builds a Zobrist key by XORing pseudorandom values assigned to the position’s active features: which pieces occupy which squares, whose turn it is, castling rights, and en-passant availability. Because XOR reverses itself when the same value is applied again, the engine can update the key as a move changes the position instead of rebuilding it from scratch. The key lets a transposition table look up previously searched positions, but it is a compact signature—not proof that two positions are identical.

What a Zobrist key represents

A Zobrist key is a fixed-width fingerprint of relevant chess state. It is not a complete board encoding: many possible positions are represented by values drawn from a finite set of keys, so two distinct positions can theoretically share one.

The key must represent more than the visible arrangement of pieces. A typical chess position hash includes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Each piece type on each square.
  • The side to move.
  • Castling rights.
  • En-passant availability, usually represented by the file on which an en-passant capture is possible.

These details matter because positions that look alike on the board can have different legal moves or game states. Omitting state that affects play can cause an engine to treat distinct positions as equivalent.

#1 Best Overall
Advanced Electronic Chess Board, Smart Computer Chess Set, AI Voice Coach Learning for Kids, ELO 2200+ for Improving Players, Magnetic Large Pieces & Board Perfect for Adults, LCD Display(Black)
  • Master-Level AI Engine: Adjustable difficulty, ELO 2200+, ideal for beginners to advanced players seeking professional-grade challenges.
  • Premium Board & Pieces: Largest-in-class 2.36-inch king and 1.22x1.22-inch squares,14.6-inch in diagonal chess board for clear visibility and comfortable play, avoiding cramped layouts.
  • Magnetic Stability: Strong yet balanced magnets secure pieces, even when the board is inverted, ensuring uninterrupted focus during intense matches.
  • Intelligent Voice Coaching: AI-driven analysis provides real-time feedback on moves, identifying weaknesses and suggesting optimal strategies.
  • Comprehensive Learning Tools: Includes 128 tactical puzzles, 256 classic game scores, and unlimited move takebacks for in-depth study and replay.

How the key is constructed

Assign reproducible values to features

At initialization, an engine generates pseudorandom bit strings for the position features it tracks. In one common scheme described by the Chess Programming Wiki, there are 781 values: 12 piece types × 64 squares, one side-to-move value, four castling-right values, and eight en-passant-file values. This is a conventional count, not a required constant; some implementations encode the 16 possible castling-right combinations directly instead of using four separate values.

Engines often use a local pseudorandom generator so that the values are reproducible across platforms. Stable keys are useful when other data, such as an opening book, is indexed by position.

Rank #2
Sale
Vonset L6 Electronic Chess Board with LED Lights E-Ink Screen Display
  • 【Chess Computer for Beginners and Kids】Great chess set for beginners and kids with LEDs to prompt you to move; Talking Chess and can get help prompting moves with the "?" button; FUN levels 1-2 to help beginners learn chess in a fun way, and 1000 built-in stalemate puzzles, all to help you learn chess faster.
  • 【Electronic Chess Set for Adults】 Suitable for chess enthusiasts to improve their chess skills. Simulate the real game scenario, time play, and support two violations of the judgments, etc. You can experience the authentic game atmosphere, constantly improve your chess skills and adjust your game status.
  • 【Computer Chess Game】Vonset L6 has rich level settings covering the level distribution from entry to proficiency. This chess computer has a strength of up to 2300 ELO (International tournament standard), which corresponds to the level of the Grandmaster and is suitable for most chess players. Note: The level setting applies to both training mode and match mode.
  • 【Electronic Chess Board】With HD E-ink screen, it can be easily viewed under any light source to protect your eyes; Built-in rechargeable battery, it can be used for up to 8 hours with a full charge; Built-in storage box inside the board, when you don't want to play chess, store the pieces in it, it is convenient to store the chess pieces to avoid losing the chess pieces.
  • 【Magnetic Chess Game】L6 chess sets with a magnetic chess board and pieces. Chess pieces are not easily dislodged when playing chess. You can play chess in a mobile environment. It can be used at home, school, outdoor camping, or traveling.2 extra queens are available for you to use as free accessories.

XOR the active values

Start with a zero key and XOR the value for each feature that applies. For example, the initial key combines the values for all pieces on their starting squares, the side to move, the current castling rights, and any applicable en-passant state.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

XOR is useful because applying the same value twice cancels it: x ^ y ^ y = x. This property makes it straightforward to add or remove a feature from the key. The approach is a form of tabulation hashing: feature values are looked up and combined with XOR.

Rank #3
Sale
P6 Electronic Chess Board Chess Computer Talking Smart Chess Board Magnetic Electronic Chess Set with LED for Kids & Adults
  • Product Dimensions: 12.6x12.13x0.9 inches (32x30.8x2.3 cm); Game area: 8.8x8.8 inches(22.5x22.5 cm); Each square: 1.1 inches (28x28mm). King height: 2 in. Package list: Electronic chess board, 34 pieces (with extra double queen), two drawstring storage bags, manual, charger cable.
  • Electronic Chess Board: Built-in AI intelligent algorithms, with 1-18 levels for beginners to intermediate players. Play against the computer or a friend, and challenge yourself anytime. The P6 Chess Computer supports up to 1700 ELO.
  • Smart Chess Board: Offers three modes: Training for beginners and kids, Match for improving skills with the device, and Human for two-player games with friends or family. Enjoy leisure time and choose the mode that suits your practice needs.
  • Learn Chess: The P6 features 200 puzzles to enhance your skills. Training mode offers light prompts and voice announcements for each move. Press the '?' button for hints when needed, making learning and playing chess easier.
  • Strong Magnetic Chess Pieces: Features strong magnetic adsorption, keeping pieces secure even when shaken. Move them easily without worry, whether at home or on the go.

How a move updates the key

Rather than scan the whole board after every move, an engine updates only the feature values affected by that move. For a white knight moving from b1 to c3 and capturing a black bishop, the update XORs out the white knight on b1, XORs out the captured bishop on c3, XORs in the white knight on c3, and toggles the side-to-move value.

Other moves must account for every changed feature, not just piece locations:

Rank #4
ChessUp 2 - Electronic Chess Board by Bryght Labs - Built-in WiFi, Chess Engine - Includes Chess Set TouchSense Pieces - Light Up Smart Chess Board - with AI, Lessons, Wireless Play & Companion App
  • MASTER CHESS AT ANY LEVEL, FROM KIDS TO EXPERTS - Whether you're just learning or leveling up your strategy, ChessUp 2, the interactive electronic chess set that lights up every move, helps you play smarter. Touch any piece to reveal potential moves, mistakes, and blunders. It’s the best way for kids and adults to learn and improve.
  • BALANCE A MATCH WITH BUILT-IN AI COACHING - ChessUp 2 lets you customize AI help for each player. Kids or beginners get guidance through light-up squares while experts play with no hints. It’s the perfect teaching tool for families, self-learners, or competitive games with a twist.
  • PLAY RANKED ONLINE GAMES, NO PHONE NEEDED - With built-in WiFi, ChessUp 2 connects to Chess.com and Lichess so you can play real-time online matches from your board. No phone or laptop required. Play with friends, challenge opponents around the world, or enjoy casual games with boys, girls, and adults at any skill level.
  • TRAIN SMARTER WITH THE COMPANION APP - The ChessUp app is your personal chess coach. Review your games, track progress, and explore expert-led lessons with portions explained within the app and shown on the board simultaneously. Whether you’re teaching, self-learning, or chasing your next win, the app helps you make better moves every time you play.
  • STUDY ANY POSITION - Set up any position, test out new strategies, or recreate famous games. Whether you're preparing an opening, teaching a tactic, or studying complex endgames, ChessUp 2 gives you total control to learn and experiment.
  • Captures: remove the captured piece’s piece-square value.
  • Castling-right changes: XOR out the old rights value and in the new one when a king or rook move, or a relevant capture, changes those rights.
  • En passant: update the en-passant state when a move creates or removes an en-passant opportunity; an en-passant capture also removes the captured pawn from its actual square.
  • Promotions: replace the pawn’s piece-square value with the promoted piece’s value on the destination square.
  • Side to move: toggle the side value after each legal move.

Because XOR is its own inverse, unmaking a move can restore the previous key by applying the same changed feature values again. The engine’s make and unmake logic must keep the key synchronized with its board and other state.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical correctness check is to keep a slower function that recomputes the key from the complete position. During development, compare it with the incremental key after generated move sequences and after unmaking those moves. A mismatch can reveal a missed state change or an incorrectly reversed update.

Best Value
Lexibook, Chessman Elite Interactive Electronic Chess CG1300
  • Complete and progressive: 64 difficulty levels divided into 4 different play games.
  • Advanced: Elo 1800 player rating system.
  • 16 LEDs (horizontally and vertically) show the moves played.
  • Training mode (improvement) indicating to the player whether the move just played is optimal or allowing the player to attempt a new move.
  • Knows the 50-move rule, “pat” and draw by repetition, pawn promotion, “en passant” capture. Solve the mate in 5 moves.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How engines use the key in a transposition table

Different move orders can reach the same position. A transposition table stores information from positions already searched so the engine can avoid repeating work. An entry may contain a key signature, a best or refutation move, search depth, score, bound type, and age.

  1. Choose a table slot. The engine reduces the position key to an index, often with modulo or by masking low bits when the table size is a power of two.
  2. Probe the entry. It checks the stored signature against the queried key information. The exact amount stored varies by implementation.
  3. Decide whether the result is usable. A sufficiently deep entry with an exact score or a suitable lower or upper bound may support an alpha-beta cutoff.
  4. Order moves when a cutoff is unavailable. The stored move can still be tried earlier, potentially improving search ordering.

The table cannot hold an entry for every possible position key, so several keys may map to one slot. A stored signature helps detect when a slot contains a different key than the one being probed.

Can Zobrist hashes collide?

Yes. It helps to distinguish two different cases:

  • Index collision: different full keys reduce to the same table slot. This is expected in a bounded table; replacement rules determine which entry remains. Comparing the stored signature catches many such mismatches.
  • Full-key collision: two distinct positions produce the same finite-width key. No comparison of that same full key can distinguish them. Wider keys reduce the probability, but do not make the hash mathematically unique.

The Chess Programming Wiki describes 64-bit keys as usual in modern chess programs. That size makes a full-key collision a low-probability risk, not an impossibility. A bounded, replacement-based table also does not retain every position ever examined, so collision exposure cannot be inferred simply by treating all searched positions as simultaneously stored.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Origin of the method

Albert L. Zobrist’s A New Hashing Method With Application for Game Playing is University of Wisconsin Technical Report #88, dated April 1970. The university record describes a general hash-coding method for game-playing programs, including chess, checkers, and Go, and notes an auxiliary method for detecting retrieval errors. The university report record preserves its bibliographic details.

The method was later reprinted in the 1990 ICGA Journal; its notes say it was refined in 1971 for subsets of the chessboard in the Zobrist–Carlson–Kalme chess program. The implementation patterns described here reflect modern chess-programming practice, rather than a claim that every engine uses identical tables or update code.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.