KEY TAKEAWAYS
CONTENTS
A casino random number generator, or RNG, is the component that decides what happens in a game of chance. It produces numbers that are meant to be unpredictable and evenly spread, and the game software then converts those numbers into something a player sees: a card from a deck, a set of reel positions, the faces of dice. The player never sees the raw numbers, only the result.
The idea is simple to state and surprisingly easy to get wrong. A generator can be fast but biased, or random-looking but guessable by someone who knows its starting point. That is why technical standards focus on three questions: where the randomness comes from, how it is turned into outcomes without distortion, and how an independent party can check both.
This guide follows the path from seed to outcome in plain language, shows the arithmetic behind two classic design pitfalls, walks through a fictional card draw, compares software, hardware and mechanical RNGs, clears up common myths, and explains what lab testing under GLI-19 does and does not prove.
From Seed to Outcome: The Basic Flow
GLI-19, a technical standard from Gaming Laboratories International, groups RNGs into three types. Software-based RNGs draw their randomness mainly from a computer algorithm. Hardware-based RNGs draw it from small-scale physical events such as electrical noise or thermal noise. Mechanical RNGs create outcomes with the laws of physics, using devices such as wheels, tumblers, blowers or shufflers.
In the most common online and machine setup, the flow has four stages:
- Seeding: the generator is started from an initial value, the seed, ideally gathered from unpredictable sources.
- Generation: the algorithm produces a stream of raw numbers, each one derived from its current internal state, which it updates after every draw.
- Scaling and mapping: a raw number is converted to the range the game needs, such as 0 to 51 for a card.
- Outcome: the game software applies its rules to the mapped value and reports the result to the platform.
The word pseudorandom describes software generators: they follow a fixed algorithm, so the same internal state always leads to the same output. Their unpredictability comes from keeping that state secret and large enough that no one can work it out. Hardware generators draw on physical noise instead, so there is no algorithm to reconstruct, although the physical source must be monitored for faults. Which type a game uses depends on the supplier and on what the regulator accepts, so the same game can run on different generators in different places.
Under the Hood: Seeds, State Size and Fair Mapping
Two design details decide whether an RNG is trustworthy: how many internal states it can reach, and how it maps numbers to outcomes. GLI-19 version 3.0 requires that the set of possible outcomes be large enough that every outcome is available on every draw, and that RNGs used for outcome determination be cryptographically strong, meaning a skilled attacker with the source code should not be able to predict future values.
The arithmetic shows why size matters. A 52-card deck can be ordered in 52! ways, and an n-bit seed can take at most 2^n values:
2^32 = 4,294,967,296 (≈ 4.29 billion)
2^64 ≈ 1.84 × 10^19
where 52! is the number of possible deck orders, and 2^32 and 2^64 are the numbers of seeds possible with 32 and 64 bits. A generator seeded with only 32 bits can produce at most about 4.29 billion different shuffles, a vanishingly small slice of 8.07 × 10^67. Covering every ordering needs at least 226 bits of state, because log2(52!) ≈ 225.6.
Mapping can also go wrong. Take a random byte (0 to 255, which is 256 values) and compute value mod 52 to pick a card. Since 256 = 4 × 52 + 48, results 0 to 47 occur 5 times each and results 48 to 51 occur 4 times each, so 48 × 5 + 4 × 4 = 256. This is modulo bias. Rejecting values 208 to 255 and drawing again leaves 208 = 4 × 52 values, so every card is equally likely. GLI-19 notes that discarding RNG values is permissible when needed to eliminate bias.
Seeding rules matter too: GLI-19 says an RNG shall not be seeded from a time value alone, and that it shall periodically modify its state using external entropy.
Walkthrough: Dealing One Card With a Fictional RNG
The following is a hypothetical example using the byte-to-card mapping above, not a description of any real game. Suppose a game needs one card from a 52-card deck, numbered 0 to 51.
- Draw: the RNG produces the byte 230.
- Range check: 230 is at least 208, so it is rejected, because keeping it would favor some cards.
- Redraw: the RNG produces 137.
- Accept: 137 is below 208, so it is kept.
- Map: 137 mod 52 = 137 − 104 = 33, so card number 33 is dealt.
- Next card: a new draw is made, and, if the deck is dealt without replacement, card 33 is removed from consideration.
The rejection step has a cost but a small one: 48 of 256 byte values, or 18.75%, are discarded, so on average a little more than one draw is needed per card. In return, the result is exact.
Because each accepted value maps to a card exactly four times, every card had the same chance. Real games use far larger generators and handle multi-card hands, but the principle of rejecting values that would create bias is the same.
Variations: Software, Hardware and Mechanical RNGs
Each RNG type has its own strengths and its own checks. The table summarizes what GLI-19 version 3.0 says about them.
| Type | Where randomness comes from | Notable requirement in GLI-19 v3.0 |
|---|---|---|
| Software-based | A computer algorithm and its seed | Must be cryptographically strong; seeding and state updates reviewed |
| Hardware-based | Physical events such as electrical or thermal noise | Output must be monitored by statistical testing, and play disabled if malfunction or degradation is detected |
| Mechanical | Physical devices such as wheels, tumblers, blowers or shufflers | Tested as physical randomness devices, unless they merely display an outcome chosen by a computer RNG |
The last case is an important detail. A device that faithfully displays an outcome selected by a computer RNG is tested as an RNG once the faithful reproduction has been assured, because the computer, not the machinery, is making the choice.
A different approach, called provably fair, is used in some games. Conceptually, the game publishes a hash of its secret seed before play, reveals the seed afterward, and anyone can recompute the hash to confirm the seed was not changed. Results are typically derived from that server seed, a player-chosen seed and a counter. Details vary by implementation, and this scheme is not a substitute for lab testing under a standard.
Myths, Limits and Misconceptions
Myth: the RNG knows when a player is winning or losing. A fair, independent RNG gives each outcome the same probability on every trial. GLI-19 describes independence as knowledge of one draw giving no information about a future draw.
Myth: a hot streak or a long drought means the next result is due. Past results do not change the next one. The chance of at least one occurrence of an event with probability p in n trials is 1 − (1 − p)^n, so a 1-in-50 event has a 1 − 0.98^50 ≈ 63.6% chance of appearing at least once in 50 independent trials, yet each single trial stays at 1 in 50.
Myth: a certificate proves every session is fair, or a missing certificate proves the opposite. A lab certificate says a tested version met a standard when it was tested. It is not a verdict on any operator and not a prediction about individual outcomes.
Limit: randomness cannot be proven by looking at a short sequence, which is why labs test large samples.
Key Facts: What Labs Check and What It Means
A summary of what GLI-19 version 3.0 asks the independent test laboratory to do, and what a reader can take from it:
| Check | What it covers |
|---|---|
| Source code review | Core randomness, scaling and shuffling algorithms, looking for bias, errors and undisclosed switches |
| Statistical analysis | Tests on final outcomes, such as chi-square and runs tests, evaluated together at a 99% confidence level |
| Distribution | Each possible selection equally likely, unless the game design says otherwise |
| Independence | One draw gives no information about another |
| Strength | Resistance to prediction, safe seeding and periodic state changes |
A certificate describes a specific tested version at a specific time, and which standard applies is decided by each regulator. Players cannot inspect an RNG themselves, but they can read a game’s published rules and the regulator’s information about how games are tested in their state.
Related Concepts and Next Steps
RNGs sit inside a larger system. For the broader picture of where the game server and wallet fit, read how online gambling platforms work behind the screen, which follows a single game round from the account to the outcome.
Natural next topics include how poker software shuffles and deals a digital deck, how automatic card shufflers work in a casino, how test labs certify game versions, and why artificial intelligence cannot predict a random outcome. Each builds on the seed, mapping and testing ideas covered here. Readers who want to go deeper can look at how provably fair systems work in more detail, or at how historical RNG flaws were found and fixed.
Frequently Asked Questions


