Casino Technology8 min read

What Is a Random Number Generator (RNG)?

A clear definition of what a random number generator actually is — the difference between algorithmic and hardware randomness, what a seed does, and why casino-grade RNGs need to meet a stricter bar than ordinary software.

Published August 29, 2026

What this guide covers

This is the concept guide: what a random number generator actually is, in principle, before any discussion of how casinos specifically deploy one. For the deployment and architecture side — how one RNG engine serves many games, server-side generation, and the request-response cycle — see How Online Casino RNGs Work. For how RNG software gets independently verified as fair, see our RNG certification guide.

The basic definition

A random number generator (RNG) is a system, implemented in either software or hardware, that produces a sequence of numbers with no discernible pattern and no predictable relationship between one output and the next. In a casino context, that sequence of numbers is what ultimately decides game outcomes — which symbols land, which card is dealt, which number a virtual roulette ball settles on. The RNG itself doesn't know or care what game is using its output; it's a general-purpose randomness engine, with the game-specific meaning applied afterward by a separate mapping layer, as covered in the architecture guide linked above.

Two fundamentally different kinds of randomness

Not all randomness is generated the same way, and the distinction matters for understanding what a casino-grade RNG actually is.

True random number generators (TRNGs), sometimes called hardware RNGs, derive randomness from a genuinely unpredictable physical process — atmospheric noise, electronic circuit noise, radioactive decay timing, or similar physical phenomena that are, as far as physics currently understands them, not deterministic even in principle. A TRNG doesn't run an algorithm to produce its output; it measures something physically chaotic and converts that measurement into a number.

Pseudo-random number generators (PRNGs) are algorithms — deterministic mathematical formulas that, given the exact same starting input, will always produce the exact same output sequence. That sounds like the opposite of random, and in a strict mathematical sense, it is: a PRNG's entire future output sequence is technically determined the moment its starting value is set. What makes a well-designed PRNG usable for gambling anyway is that its output is computationally unpredictable — even someone who knows the exact algorithm being used cannot predict the next number in the sequence without knowing the specific current internal state, and recovering that internal state from observed outputs alone is designed to be effectively impossible given realistic computing resources.

Online casinos overwhelmingly use PRNGs rather than TRNGs, for practical reasons: PRNGs are dramatically faster, don't require specialized physical hardware at every server, and — critically — are considerably easier to test and certify, since a deterministic algorithm can be analyzed, audited, and statistically tested by an independent lab in ways a genuinely physical, one-off random process cannot be replayed and re-examined after the fact in the same way.

The seed: where a PRNG's sequence actually begins

Every PRNG algorithm needs a starting value, called a seed, to begin generating its sequence. This is the single most security-critical detail in the entire system: because a PRNG is deterministic, anyone who knew the exact seed and the exact algorithm could, in principle, reproduce the entire resulting sequence. Casino-grade RNG implementations treat seed generation and protection as a serious security requirement, typically drawing seed values from genuinely unpredictable sources — hardware entropy sources measuring physical noise, similar in spirit to a TRNG — specifically so the seed itself can't be guessed, predicted, or reverse-engineered from outside the system.

What "random" actually needs to mean here

Two formal properties define whether an RNG is doing its job correctly, and both get tested rigorously during independent certification:

  • Unpredictability: given every output the RNG has produced so far, an observer should have no better ability to predict the next output than pure random guessing would provide. There should be no detectable formula, cycle, or pattern.
  • Independence: each output should be statistically unrelated to every other output. The RNG has no concept of "owing" a particular result because of what happened previously, and no internal counter tracking how long it's been since a specific outcome occurred.

Independence is the property behind why a slot or roulette wheel can never be meaningfully "due" for a particular result — a concept covered in far more practical depth, with the underlying reasoning worked through concretely, in guides like online slot mathematics explained. This guide is concerned with the RNG concept itself rather than the gameplay implications, which are covered thoroughly elsewhere.

A brief history of RNG in gambling technology

Mechanical gambling devices predate any electronic RNG by decades — a physical reel strip or a roulette wheel is itself a kind of analog random number generator, with randomness coming from mechanical friction, momentum, and human handling rather than any algorithm. As gambling machines went electromechanical in the mid-20th century, early electronic RNGs were relatively simple circuits, and as the industry moved to fully digital, software-driven games from the 1980s onward, algorithmic PRNGs became the standard mechanism, refined over decades into the rigorously tested, independently certified systems used across the regulated online casino industry today. The specific algorithms in use have also evolved considerably — modern casino-grade PRNGs are typically built on cryptographically secure algorithm families, chosen specifically because their mathematical properties resist the kind of pattern analysis and prediction attacks that older, simpler PRNG designs were more vulnerable to.

Why an ordinary software RNG isn't good enough for gambling

Programming languages and general-purpose software frameworks almost all include a built-in random number function, and it's worth being clear about why casino platforms don't simply use those. General-purpose PRNGs, the kind used for shuffling a playlist or randomizing a non-gambling game's minor visual details, are typically optimized for speed and statistical "good enough" behavior for low-stakes use cases, not for resistance against a determined, technically sophisticated attacker specifically trying to predict or manipulate outcomes tied to real money. Casino-grade RNGs are held to a materially higher bar: cryptographically strong algorithms, carefully protected and frequently refreshed seeding, and mandatory independent, ongoing certification — none of which apply to an ordinary programming language's default random function.

Period length: why a PRNG's cycle matters

Every PRNG algorithm has a mathematical property called its period — the number of outputs it can produce before its internal sequence would theoretically begin repeating itself. A weak or poorly designed PRNG might have a period short enough that, given enough observed outputs, a pattern could eventually become detectable or the sequence could even repeat within a realistic volume of play. Casino-grade PRNG algorithms are specifically chosen for astronomically long periods — commonly expressed as a number so large that even a casino generating outputs continuously, nonstop, for the RNG's entire operational lifetime, would never come remotely close to exhausting the sequence or reaching a repeat. This is one of several concrete, testable properties an independent certification lab checks directly, rather than something inferred indirectly from a game simply "feeling" random over an ordinary player's session.

How statistical randomness is actually tested

It's worth being concrete about what "testing for randomness" actually involves, since it's easy to treat RNG certification as a vague stamp of approval rather than a specific, mechanical process. Testing labs run an RNG's output through standardized statistical test suites, checking for things like: whether certain digit sequences or bit patterns appear more or less often than pure chance would predict, whether there's any detectable correlation between consecutive outputs, and whether the distribution of outputs across the full possible range matches what a genuinely random process should produce, all evaluated across sample sizes running into the billions of generated values. Passing this kind of rigorous statistical battery is a considerably higher and more specific bar than a human simply eyeballing a short run of numbers and concluding they look sufficiently scattered.

Frequently asked questions

Is a PRNG really random if it's just a deterministic algorithm? In the strict philosophical sense, no — a PRNG's output is technically determined by its seed. In the practical sense that matters for fairness, yes: a properly designed, properly seeded PRNG is computationally unpredictable, meaning no realistic attacker can forecast its next output, which is the standard that actually matters for a fair game.

Do any online casinos use true hardware RNGs instead of algorithms? Some do incorporate hardware-based entropy sources, particularly for generating and refreshing seed values, but the actual high-speed, high-volume output used to resolve individual game outcomes is almost universally produced by a certified algorithmic PRNG rather than a pure hardware RNG, for the speed and testability reasons described above.

What happens if someone discovers a casino's RNG seed? This is precisely why seed protection and periodic reseeding are treated as serious security requirements rather than afterthoughts — a compromised seed would, in theory, let an attacker predict future outputs, which is exactly the failure mode the entire security architecture around seeding is designed to prevent.

Is a PRNG the same thing across every casino game? The underlying certified PRNG engine is often shared infrastructure across many games from the same provider, but each game applies its own mapping layer to translate the PRNG's raw output into that specific game's outcomes, covered in How Online Casino RNGs Work.

Why does independent certification matter if the algorithm is already mathematically sound? A mathematically sound algorithm can still be implemented incorrectly, seeded poorly, or configured with an error that undermines its theoretical properties in practice. Certification tests the actual, deployed, real-world implementation rather than just the algorithm in the abstract — see our RNG certification guide for what that testing process specifically checks.