How casino RNGs work
Every certified game outcome is a number from a random number generator, mapped to a symbol. What the generator actually is — pseudorandom, cryptographic or hardware — how it is seeded, how numbers become outcomes without bias, and an honest answer to whether online slots are rigged.
Behind every certified casino outcome is a number. A spin, a card, a dice roll — the game asks a random number generator for a value and maps that value to what you see. So the honest questions are three: what is that generator, where does its randomness come from, and how does a raw number become an outcome without quietly favouring one result over another? This chapter answers all three from the primary standards, and then hands you a generator you can break yourself.
Three kinds of generator
The word “RNG” hides three different things. NIST’s test-suite standard draws the line cleanly. A pseudorandom number generator (PRNG) is an algorithm: “the outputs of a PRNG are typically deterministic functions of the seed; i.e., all true randomness is confined to seed generation”. Give it the same seed and it produces the same sequence, every time. That is not a flaw in itself — properly built PRNGs pass the same statistical tests as physical noise — but it means the seed carries all the real unpredictability.
A true (hardware) RNG is the opposite: NIST describes it as using “a non-deterministic source (i.e., the entropy source)” — some physical quantity “such as the noise in an electrical circuit… or the quantum effects in a semiconductor.” GLI-11 says the same for gaming hardware: hardware RNGs derive randomness “from small-scale physical events such as electric circuit feedback, thermal noise, radioactive decay, photon spin”. A cryptographically secure PRNG (CSPRNG) sits between them: an algorithm like a PRNG, but one engineered so that observing its output tells you nothing usable about its future. It is the standard workhorse for game outcomes, usually seeded from a hardware entropy source.
Seeding and state
A software generator has an internal state and an update rule; each request advances the state and returns a value derived from it. Everything hinges on how that state is first set — the seed. GLI-11 is blunt about it: the seed “shall be randomly determined by an uncontrolled and unpredictable event”, the set of available seeds must be large enough to keep outcomes independent, and “the manufacturer must ensure that games will not synchronize, even when powered-on or booted simultaneously.” For cryptographic generators it goes further: the RNG “must not be seeded from a time value alone”. That single sentence rules out the classic amateur mistake — seeding from the clock — because a clock value is guessable, and a guessable seed makes a deterministic generator’s whole future guessable.
The standard also requires the state to keep moving. Between games the generator must modify its state — GLI-11 lists “background cycling” (discarding an unpredictable number of values) and re-seeding from an external entropy source as acceptable methods — so that a game is never resumed from a state an observer could have tracked. Hardware devices, it notes, “are considered to modify their state continuously.”
From a number to an outcome — and the modulo trap
A generator emits a number in some large range; a game needs, say, a reel stop from 1 to 32. Mapping one to the other sounds trivial and is the single most common place a well-intentioned implementation introduces bias. The naive method — take the number modulo 32 — is subtly unfair whenever the generator’s range does not divide evenly by 32.
This is not a footnote in the standards — it is a requirement. GLI-11 mandates that “each possible RNG selection shall be equally likely to be chosen” (or match the declared distribution), that “all scaling, mapping, and shuffling algorithms used shall be entirely free of bias,” and it explicitly permits the remedy: “the discard of RNG values is permissible in this context and may be necessary to eliminate bias.” The laboratory checks the mapping in source-code review, then tests the final outcomes against the intended distribution — the number and its translation are both on the hook.
Predict the next spin
To feel why the kind of generator matters, break a weak one. Below is a deliberately feeble 16-bit generator picking numbers 1–10. Reveal six outputs, then let the page reconstruct its internal state and predict the seventh before it happens. It will be exact.
A deliberately weak 16-bit generator is picking numbers 1–10. Reveal six, then try to predict the seventh. The sequence is the same on every page load by design — it runs from a fixed seed, not Math.random() — so everyone sees the same honest walkthrough.
Six outputs were enough to reconstruct the generator’s internal state and read the future off it. That is what “weak” means: the state space is tiny and the update rule is linear, so a few samples pin it down. Real gaming RNGs are cryptographically secure — their state is hundreds of bits and their output is designed so that no amount of observed history lets you run this attack. That is the entire point of a CSPRNG, and why this demo is a museum piece, not a strategy.
Six samples were enough because the state space is tiny and the update rule is linear — so a handful of outputs pins it down and the rest of the sequence falls out. This is precisely the attack the gaming standards are written to make impossible. A cryptographic RNG must, in GLI-11’s words, resist a “Direct Cryptanalytic Attack: given a sequence of past values produced by the RNG, it shall be computationally infeasible to predict or estimate future RNG values”. NIST frames the same property as forward unpredictability: “if the seed is unknown, the next output number in the sequence should be unpredictable in spite of any knowledge of previous random numbers in the sequence”. The demo’s generator has a 65,536-value state you can search in a blink; a real generator’s state is hundreds of bits, and the same search would outlast the universe.
So, are online slots rigged?
Put plainly: in a licensed market a certified game is not secretly rewriting outcomes against you, and it is tested so that it cannot. The independence requirement — “knowledge of the numbers chosen in one draw shall not provide information on the numbers that may be chosen in a future draw” — forbids the “memory” a rigged machine would need, and the certified game already carries a built-in edge that makes any covert manipulation both unnecessary and, in a regulated venue, ruinous to get caught doing. That is the honest reassurance. The honest caveat is equally important: “certified” describes a tested build against a written standard, not a metaphysical guarantee. Generators have failed — through insiders and through attackers — and statistical testing has limits the testers themselves spell out. Those are the next two chapters: what RNG tests can and cannot prove and when certified RNGs failed.
Common questions
Are online slots rigged?
In a licensed market, an online slot cannot legally adapt its outcomes to a player and is tested so that it does not. Certification standards such as GLI-11 require each outcome to be equally likely (or to match a declared distribution), require draws to be statistically independent so that "knowledge of the numbers chosen in one draw shall not provide information on the numbers that may be chosen in a future draw," and require the generator to be unpredictable. The honest answer is therefore: a certified game is not secretly rewriting outcomes against you — but "certified" is a claim about a tested build, not a guarantee that nothing can ever go wrong, which is why documented failures and the limits of testing are covered in their own chapters.
Can a casino change the RNG on the fly to make me lose?
Not in the sense people usually mean. Certified games are built so each round is drawn independently, with the generator forbidden from discarding or modifying selections based on previous ones except where the game design declares it. What an operator can change is which certified configuration of a game is deployed — the same title sometimes ships at 96%, 94% or 92% — but that is a separate certified build, not a live tweak aimed at one player. The distinction is the subject of the configurable-RTP chapter in the RTP pillar.
Sources (2)
- NIST SP 800-22 Rev. 1a — A Statistical Test Suite for Random and Pseudorandom Number Generators (§1.1 definitions and unpredictability)nvlpubs.nist.gov
- GLI-11 Gaming Devices in Casinos, v3.0 (2016) — Chapter 3: Random Number Generator Requirementsgaminglabs.com
Education, not advice. This chapter explains how the random number generators behind casino games are built, tested and certified so you can judge the claims made about them honestly. It is not a system, and nothing here treats gambling as a way to make money — over enough play the mathematics favours the house. 18+.
Next in the pathWhat RNG tests can and cannot prove