Zobrist explained in plain terms means understanding the hashing trick that lets a chess engine recognise a position it has seen before, a table of random numbers combined with XOR that turns a whole board into a single key. The central question is why a hash needs random numbers at all when a board could simply be written down, and the answer is that a board written down takes time to compare, so a hash that updates in a single step lets an engine search millions of positions a second.
Zobrist hashing was published by Albert Zobrist in 1970, in a technical report from the University of Wisconsin called A New Hashing Method with Application for Game Playing. Each piece on each square gets its own random number, and the hash of a position is the XOR of the numbers for the pieces on the board, which means a move changes the hash by XORing out the old square and XORing in the new one, and because XOR is its own inverse, the update costs almost nothing.
This article explains what Zobrist hashing is, how it works, and where it runs in the real world.
Key takeaways
- Zobrist hashing turns a board position into one key.
- Albert Zobrist published it in 1970.
- Each piece on each square gets a random number.
- XOR combines the numbers into the hash.
- It powers transposition tables in chess engines.
What Zobrist hashing is
Zobrist hashing is a method for hashing a game position into a fixed-size number, and that fixed size is what makes it unusual among hashing designs. A chess board has 64 squares and 12 piece types, so the method keeps a table of 768 random 64-bit numbers, which means every possible piece on every possible square has its own key, and because the numbers are random, two similar positions get entirely different hashes.
Its signature feature is the incremental update. Most hash functions must read the whole input again, but Zobrist hashing updates a position by XORing the numbers that changed, which means a move that touches two squares costs two XOR operations, and because XOR undoes itself, the same operation both adds and removes a piece.
The scheme was a reaction to the cost of searching game trees. Early game programs wasted time re-evaluating positions they had already seen through different move orders, so Zobrist asked whether a position could be recognised cheaply, because a search that repeats work is a search that loses games, and that practicality is what made Zobrist hashing worth building.
It became one of the best-known hashing methods in the world, and it is named in every discussion of the field. The report appeared in April 1970, the method was reprinted in the ICGA Journal in 1990, it was rediscovered as tabulation hashing by Carter and Wegman in 1977, and it is still the first example engineers meet when they learn that a hash can be updated rather than recomputed, which means the scheme survives as a standard even though modern engines add neural networks on top.
Our guide to hashing explains the general hash functions that Zobrist hashing builds on, and our guide to CRC32C explains the checksum that takes a different approach to the same problem.
How Zobrist hashing works
Everything starts with the table, which sets the keys. At startup the program fills a table with a random 64-bit number for each combination of piece and square, which means 768 numbers for chess, and because the numbers are fixed for the whole game, every position is hashed against the same table.
Each step begins with the XOR, which builds the hash. The program walks the board, XORing together the numbers for the pieces it finds, which means the result is a single 64-bit value that stands for the whole position, and because the starting value is zero, an empty board hashes to zero.
The move is what makes the design work as a whole. When a piece moves, the program XORs out the number for its old square and XORs in the number for its new square, which means the hash follows the game without ever rescanning the board, and because a capture touches one more square, even a capture costs only three XOR operations.
The state flags are what turn the scheme into a complete position key. Castling rights, en passant and the side to move each get their own random numbers too, which means two boards that look identical but differ in rights hash differently, and because the rules of chess treat them as different positions, the hash must as well.
The transposition table is what turns the hash into wins. The engine stores evaluated positions in a table keyed by their Zobrist hash, which means a position reached by a different move order is recognised instantly, and because game trees are full of such transpositions, the table saves a large share of the search.
The result comes from the lookup, read out as a hit or a miss. The engine computes the hash of the current position and checks the table, which means a hit returns a stored evaluation and a miss triggers a fresh search, and that verdict is exactly what a chess engine needs to make a fast decision.

Comparing Zobrist hashing with other hash functions
Zobrist hashing is one of several ways to turn data into a hash, and each was built with a different emphasis. Polynomial hashing is the classic string design built for rolling windows, CRC32C is the checksum built for detecting errors, and Zobrist hashing is the one built to update in place, while each approach trades something for something else.
The table below sets out the main contrasts between the leading approaches.
| Aspect | Zobrist | Polynomial Hash | CRC32C |
|---|---|---|---|
| Incremental update | Yes, two XORs | Yes, rolling | No, rescan needed |
| Collisions | Random, rare | Modulo based | Designed to catch |
| Speed | Near free per move | Fast per window | Hardware assisted |
| Use | Game positions | String search | Storage checks |
| Best for | Transposition tables | Pattern matching | Data integrity |
The practical result is that Zobrist hashing is the right choice for transposition tables, polynomial hashing suits pattern matching, and CRC32C fits data integrity instead.
Where Zobrist hashing is used
Chess engines use it to cache positions. Every serious engine keeps a transposition table keyed by Zobrist hashes, because a search that recognises a repeated position can reuse its evaluation, and that reuse is the reason Zobrist hashing earns its keep in computer chess.
Go programs use it for board states. The method was first built for game playing, and Go engines adopted it for the same reason, because a board with hundreds of intersections needs a hash that updates cheaply, and that economy is the reason the design was built for board games.
Search algorithms use it for repeated states. Any search that can reach the same state by different paths benefits from recognising it, because a state that is hashed once need never be expanded twice, and that saving is the reason Zobrist hashing appears in planning far beyond its game origins.
Databases use it for set fingerprints. The same XOR trick fingerprints a set of values, because adding or removing a member is one XOR either way, and that symmetry shapes how new sketching methods are configured.
Teaching uses it as the incremental hash example. Courses introduce Zobrist hashing when they explain that a hash need not be recomputed from scratch, because it is the clearest case of an update that costs almost nothing, and a student who understands Zobrist hashing understands why XOR is a hash designer’s friend.
Strengths and limits
The greatest strength of Zobrist hashing is its update speed. A hash that follows a move in two operations is a rare achievement, and that strength is real, measured in the millions of positions engines evaluate and confirmed by the tables that still rely on it.
It is also a strength that the method is simple. A table of random numbers and an XOR is all an implementation needs, and that simplicity is worth more than cleverness in a field where a hash that needs a manual is a hash that will be implemented wrong.
The limits are real, though, and the biggest is the collision risk. Two different positions can share a hash, which means an engine must verify a table hit before trusting it, and a system that needs real security must never use Zobrist hashing as a cryptographic hash.
Zobrist checklist
- Use Zobrist hashing for game states, never for security.
- Remember Albert Zobrist published it in 1970.
- Note each piece on each square gets a random number.
- Compare it with polynomial hashing to see update versus window.
- Study the XOR, which is what makes updates free.
- Check the state flags, since rights change the position.
- Keep the table fixed, since the hash must be stable.
- Read the 1970 report to see how the method was set.
- Choose Zobrist hashing when positions repeat and speed matters.
Frequently asked questions
What is Zobrist hashing in simple terms?
It is a way to turn a board position into a single number by XORing together random numbers assigned to each piece on each square.
Who created Zobrist hashing?
Albert Zobrist, who published it in April 1970 in a University of Wisconsin technical report on hashing for game playing.
How is Zobrist hashing different from a normal hash?
A normal hash reads the whole input each time, but Zobrist hashing updates its value with a couple of XOR operations when a piece moves.
Is Zobrist hashing still secure?
It was never meant for security, and collisions are possible, so it should only be used for caching game positions and similar non-security tasks.
Where is Zobrist hashing used?
In chess engines, in Go programs, in search algorithms that revisit states, and in set fingerprinting.
When should I use Zobrist hashing?
When you cache repeated states, when updates must be nearly free, or when you study incremental hashing.
The bottom line
Zobrist explained in one line is this: a board in a number, a 1970 trick that let chess engines recognise a position in two XOR operations and taught the field that a hash can be updated instead of rebuilt.
It is proof that a table of random numbers can outlive the era that built it, and the reason it still matters is that every incremental hash designed since has been judged partly by the lesson Zobrist taught.
This article is general information about how Zobrist hashing works, not advice about choosing a hashing scheme for a particular system or workload.







