Skip to main content
Slots guide

How random number generators work in online slots

An RNG is software that produces unpredictable numbers, which a game turns into results using its published rules. UK rules require that output to be demonstrably random.

· · 5 min read

Add as a preferred source on Google
Lucky Tiger News title card: How random number generators work in online slots

A random number generator, or RNG, is the part of an online game's software that produces the numbers behind every result. When you start a spin, the game takes numbers from the RNG and converts them into an outcome using its own rules and pay table. The RNG decides what happens. The game's maths decides what each outcome is worth and how often it should turn up over a very large number of plays.

That division of labour explains most of what people get wrong about slots, so it's worth taking each part in turn.

What does "random" mean for a computer?

Software follows instructions, so its randomness is of a particular kind. The Gambling Commission notes, writing about gaming machines, that "random" usually means "pseudo random": the numbers come from a method rather than a physical event such as a ball dropping into a pocket.

What matters is whether the result behaves as random in practice. For online gambling, the Gambling Commission requires RNG output and game results to be "acceptably random". That means it must be possible to show, to a high degree of confidence and using generally accepted statistical tests, that the outcomes are random. Its guidance sets out the qualities an RNG should be able to demonstrate:

  • Even spread. Numbers are spread uniformly across the whole possible range, and game outcomes occur in line with their expected probabilities.
  • Unpredictability. For a software RNG, it should be computationally infeasible to predict the next number without complete knowledge of the algorithm and its starting value, known as the seed.
  • No repeating patterns. The generator shouldn't fall into repeating the same stream of numbers, and two copies of it shouldn't produce matching streams.
  • Safe seeding and scaling. Neither the way the RNG is seeded nor the way its output is converted for a game should make results more predictable.

How does a number become a spin result?

The RNG's raw output usually covers a far wider range than a game needs, so the game scales it down and maps it onto possible outcomes, such as a stopping position on a reel. The Gambling Commission requires that this mapping follows the game's stated probabilities and pay tables, and that numbers are used in the order they arrive. A game may only set a number aside if it falls outside the range the game needs, and that should be logged as an error and investigated.

A hypothetical example

Say a simplified reel has 20 positions, two of which show a bar symbol. The game asks the RNG for a number, scales it to a value from 1 to 20, and stops the reel at the matching position. Each position is equally likely, so the chance of a bar on that reel is 2 in 20, or 10%, on every spin.

Now add two more identical reels, each driven by its own independent number. The possible combinations multiply.

Hypothetical outcomeCombinationsChance per spin
Any result across three reels20 x 20 x 20 = 8,000Certain
Bar on reel one2 of 20 positions1 in 10
Bar on all three reels2 x 2 x 2 = 88 in 8,000, or 1 in 1,000

The point of the example is that the RNG treats every number the same. It's the game designer's choice of reel layout and prize values that sets how often a combination appears and what it pays. Real games have their own designs, and the figures that matter are the ones in each game's rules or help pages.

What an online RNG game isn't allowed to do

The Gambling Commission's online standards close off several ways a game could quietly work against the randomness described above.

  • No compensation. Adaptive behaviour is not permitted. A game can't make automatic or manual interventions that change the probabilities of outcomes during play, for example to catch up on a target payout. Bonus features with different rules are allowed, as long as they are triggered by random events.
  • No false near misses. A game can't swap one losing result for a different losing result that looks closer to a win.
  • Honest simulations. If a game imitates a physical device, the probabilities must match the real thing. The Commission's example is a coin: the chance of heads must be 0.5 on every toss.
  • No mid-game changes. Rules, payouts and outcome probabilities can't change while a game is available for gambling, except where the game's own rules provide for it, and changes must be brought to customers' attention.

Because the probabilities stay fixed, a spin doesn't become more or less likely to win because of what came before it.

Machines in venues can work differently

This is where scope matters. The rules above apply to online games. Gaming machines in venues such as pubs and arcades also use an RNG, but the Gambling Commission explains that some of them are "compensated": they adjust the chance or size of wins depending on whether recent payouts are above or below the target return. Other machines in venues are fully random, where the odds of a win stay constant and are unaffected by previous games. Machines must say which type they are. Online, compensation is not permitted.

Is every casino game run by an RNG?

No. Live dealer games use physical equipment, such as roulette wheels and decks of cards, to decide results, with separate integrity controls around that equipment. Some games use the laws of physics to produce outcomes, which the standards call mechanical RNGs, and those must still meet the randomness requirements. Play-for-free versions of games must follow the same rules as the real-money versions on the same site and accurately represent the likelihood of winning.

Before release, an online RNG must also go through independent testing, including statistical testing of its output, and operators must monitor how games perform once they are live. The detail of that process is a topic in its own right.

What this means for you

The useful way to think about an RNG, I'd suggest, is as a referee rather than a player. It makes each result unpredictable and independent, but it doesn't decide how generous a game is. That's set by the game's maths, which is built so that, across a very large number of plays, less comes back in prizes than goes in as stakes. The house keeps a margin over time.

So no pattern, timing or sequence of spins can tell you what comes next, and the result of any single spin, or any single session, is down to chance. Gambling costs money, and the RNG is there to make sure the cost is applied fairly, not to change it. If you want to know what a particular game offers, the Gambling Commission requires its rules, how winners are determined and its return to player percentage, house edge or probability of winning to be easily available before you commit to play.

Sources: UK Gambling Commission, Remote gambling and software technical standards: RTS 7, generation of random outcomes; UK Gambling Commission, Remote gambling and software technical standards: RTS 3, rules, game descriptions and the likelihood of winning; UK Gambling Commission, Remote gambling and software technical standards: RTS 6, result determination for play-for-free games; UK Gambling Commission, How can gaming machines meet their %RTP if they are random? (LA Bulletin, August 2020); UK Gambling Commission, Return to player: how much gaming machines pay out; UK Gambling Commission, Live return to player performance monitoring of games of chance; UK Gambling Commission, Testing strategy for compliance with the remote technical standards: procedure for testing.

How this was written. Drafted with AI assistance from the sources listed above in Harvey Watkins's style and published after automatic checks for accuracy and compliance, without a line-by-line read by an editor. If you spot a mistake, tell us. Our editorial standards.

More Guides