Random Number Generator

Generate a random whole number between any two values.

Random, pseudo-random, and which one you need

Most software randomness is pseudo-random: a deterministic algorithm that produces a sequence statistically indistinguishable from random, starting from a seed value. Give it the same seed and you get the same sequence every time. That reproducibility is a feature rather than a flaw for simulations and testing, where being able to repeat an experiment exactly is essential.

True randomness draws on physical processes — atmospheric noise, radioactive decay, thermal noise in hardware — and is not reproducible. The distinction becomes critical for anything security-related: cryptographic keys, tokens and passwords must use a cryptographically secure generator, because an ordinary pseudo-random generator's internal state can sometimes be reconstructed from its outputs, making future values predictable. For picking a raffle winner, shuffling a playlist or rolling dice in a game, ordinary pseudo-randomness is entirely adequate. One further point worth knowing: genuine randomness produces clusters and streaks, so a run of repeated values is normal rather than evidence that a generator is broken.

Frequently asked questions

What is the difference between random and pseudo-random?

Pseudo-random numbers come from a deterministic algorithm and a seed, so the same seed reproduces the same sequence. True random numbers derive from physical processes and cannot be reproduced.

When does the difference actually matter?

For security. Cryptographic keys, tokens and passwords need a cryptographically secure generator, since ordinary pseudo-random state can sometimes be inferred from outputs. For games, sampling and shuffling, pseudo-random is fine.

Why did I get the same number several times in a row?

Because genuine randomness clusters. Streaks and repeats occur naturally and are expected in random sequences; a generator that never repeated would in fact be less random, not more.

What is a seed?

The starting value a pseudo-random algorithm works from. The same seed always produces the same sequence, which is useful when you need a simulation or test to be exactly reproducible.