How Random Number Generators (RNGs) Work in Casino Games
How casino RNGs produce random results, how a number becomes a roulette pocket or slot symbol, how games are tested, and why no machine is ever due to hit.
Key takeaways
- Digital casino games use random number generators: physical noise sources, deterministic pseudorandom algorithms, or both combined.
- A random number is mapped to an outcome such as a roulette pocket or a reel stop; careless mapping creates small biases that good designs eliminate.
- On a slot, the result is fixed the moment the spin is triggered; the spinning reels and stop button are display only.
- Regulated games are statistically tested before release, and every result is independent, so no machine is hot, cold or due.
On this page
Every digital casino game, from a slot to an online roulette wheel, gets its results from a random number generator (RNG). The RNG produces numbers that no one can predict, the game maps each number to an outcome, and the pay table does the rest. Understanding how that works clears up nearly every myth about hot machines, cold machines and jackpots that are due.
Two kinds of randomness: physical and pseudo
There are two broad ways to make random numbers, and serious systems often combine them.
| Type | Where the randomness comes from | Strength | Weakness |
|---|---|---|---|
| Hardware (true) RNG | Physical noise, such as tiny electrical fluctuations in a circuit | Not generated by a formula | Slower, and needs checks for physical faults or drift |
| Pseudorandom (PRNG) | A mathematical formula applied to an internal state, starting from a seed | Fast and repeatable for testing | Fully predictable if the state is known |
| Cryptographically secure PRNG | A PRNG designed so outputs reveal nothing usable about its state | Fast and practically unpredictable | Only as good as its seeding and implementation |
A common design seeds a cryptographically strong PRNG with physical noise and reseeds it from time to time. You get the speed of an algorithm with a starting point nobody can guess.
Live-dealer games are different: they use real cards, real wheels and real dice, so the randomness is physical, just as in a land-based casino.
A toy PRNG you can run by hand
The simplest pseudorandom generator is a linear congruential generator. Here is a tiny one:
Step through it: 7 → (35 + 3) mod 16 = 6 → (30 + 3) mod 16 = 1 → 8 → 11 → 10 → 5 → 12 → 15 → 14 → 9 → 0 → 3 → 2 → 13 → 4 → and back to 7.
The output looks scrambled, and it does hit all 16 values before repeating. But look closer: odd, even, odd, even, every single time. Anyone who spots that pattern can predict half of every next number.
That is exactly why simple generators like this are unfit for gambling. Real game RNGs use far larger internal states and stronger algorithms, so their sequences do not repeat in any practical time frame and cannot be predicted from their outputs.
From a random number to a pocket or a symbol
An RNG typically produces a large whole number, say anywhere from 0 to 4,294,967,295 (the range of a 32-bit number, 2^32 values). The game then has to turn that into one of 37 roulette pockets or a set of reel positions. This step is where careless code goes wrong.
The modulo bias trap
The obvious approach is to divide by 37 and take the remainder. To see the problem, imagine a smaller 8-bit generator with 256 possible values. Since 256 = 6 × 37 + 34, the remainders 0 through 33 each come from 7 different values, while 34, 35 and 36 come from only 6.
- Pockets 0 to 33: probability 7/256 ≈ 2.73% each
- Pockets 34 to 36: probability 6/256 ≈ 2.34% each
- Fair probability: 1/37 ≈ 2.70%
With a 32-bit generator the effect is tiny: 2^32 = 116,080,197 × 37 + 7, so seven pockets get one extra value out of more than 116 million, a relative bias of about 9 in a billion. Tiny is still not zero, so good designs remove it completely with rejection sampling: throw away the top 7 values (4,294,967,289 and above) and draw again. Every pocket then has exactly the same number of values.
Weighted reels
On slots, the mapping is also where the math of the game lives. Picture a hypothetical reel that shows 22 symbols, but maps random numbers onto 64 virtual positions. If the top symbol occupies just 1 of the 64, three of them in a row has probability (1/64)^3, or 1 in 262,144, even though the symbol fills one of the 22 visible stops. If each visible stop were equally likely, the same line would be 1 in 22^3 = 10,648, about 25 times more often. Weights like these, together with the pay table, set the game's RTP and volatility.
When is the outcome decided?
At the moment you trigger the spin. The game draws its random numbers, looks up the result, and only then animates the reels toward it.
That has three consequences. Pressing stop early only cuts the animation short. Spinning faster or slower changes nothing. And a symbol landing just above the payline is a display result chosen by the mapping, not a near escape; see the near-miss effect for why that feels so meaningful anyway.
Many machines keep their RNG running continuously, even when idle, at speeds no person could time. Which number you get depends on the exact instant you press, which is itself unpredictable.
How RNGs are tested
A fair RNG has to pass two kinds of scrutiny: its numbers must be statistically indistinguishable from randomness, and the game built on it must pay at the probabilities its design claims.
Statistical tests look for patterns: are all values equally frequent, are runs as long as chance predicts, does one output hint at the next? A simple example is the chi-square test. Suppose a digital die is rolled 600 times and lands 92, 108, 97, 104, 95 and 104 times on the six faces, against 100 expected each.
Chi-square = Σ (observed − expected)² ÷ expected = (64 + 64 + 9 + 16 + 25 + 16) ÷ 100 = 1.94. With five degrees of freedom, only values above about 11.07 would be suspicious at the usual 5% threshold, so this die looks fine. Real test suites run many tests like this over millions or billions of outputs.
In regulated markets, games are typically tested by independent laboratories against the regulator's technical standards before release. Examples of regulators include the UK Gambling Commission, the Malta Gaming Authority, the New Jersey Division of Gaming Enforcement and the Nevada Gaming Control Board.
Some online games use a provably fair design instead of, or alongside, lab testing. The operator publishes a cryptographic fingerprint of its secret seed before you play, you add your own seed, and the seed is revealed afterward so you can recompute the result and confirm it was not changed after your bet.
RNG myths that cost players money
- The machine is due. Each spin uses fresh numbers and has no memory; see the gambler's fallacy.
- Hot and cold machines. Streaks and dry spells are normal clumps in random data, not states the machine is in.
- Stopping the reels changes the outcome. The result was decided when the spin began.
- Random means evenly spread. Real randomness clusters. Short sequences that look too even are the suspicious ones.
The bottom line
An RNG is the dice of a digital casino. Well-built ones combine unpredictable seeding with strong algorithms, map numbers to outcomes without bias, and are tested before players ever see them.
What an RNG cannot do is remember. Every result is independent, decided at the press of a button, and shaped by a design that includes the house edge. Fair randomness tells you the game is honest, not that it is winnable.
Slot RTP & Volatility Simulator
See what 96% RTP really means across thousands of sessions. Put this guide into practice right now.
Frequently asked questions
Are casino RNGs truly random?
Most use pseudorandom algorithms, which are deterministic but unpredictable without knowing their internal state, often seeded from physical noise. For gambling purposes the key properties are unpredictability and correct probabilities, which testing is designed to verify.
Does stopping the reels early change the result?
No. The outcome is selected when the spin is triggered. Pressing stop only shortens the animation that reveals a result that has already been decided.
Can a slot be due for a jackpot?
No. Each spin uses fresh random numbers and has no memory of previous spins, so a long dry spell does not make the next spin more likely to pay.
Who checks that casino RNGs are fair?
In regulated markets, games are typically tested by independent laboratories against the regulator's technical standards before they can be offered. Examples of regulators include the UK Gambling Commission, the Malta Gaming Authority and the Nevada Gaming Control Board.
Keep learning
How Slot Machines Work: Reels, RNG, Paylines & Near-Misses
How slot machines really work: the random number generator, virtual reels, paylines, RTP, volatility and near-misses, with a fully calculated example machine.
Read guide →RTP vs. Volatility: What Slot Numbers Really Mean
RTP sets the long-run cost of a slot and volatility sets the swings. Three machines with the same 96% RTP show why your session rarely looks like the average.
Read guide →The Gambler's Fallacy: Why Due Numbers Don't Exist
After 10 blacks in a row, red is still 18 in 37. Learn why independent outcomes have no memory, why streaks are normal, and when the past really does matter.
Read guide →