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.

Worked example

Say you run a giveaway with 250 entries, numbered 1 to 250. Set the minimum to 1 and the maximum to 250 and generate one number. Every entry has the same 1 in 250 chance, which is 0.4%. If you need three winners, generate again and skip any number already drawn, so no one wins twice.

For a fair public draw, record your screen while you generate the number, or have a second person watch. The maths is fair either way, but a visible process is what makes people trust the result.

Common mistakes to avoid

  • Expecting no repeats. In a true random draw from 1 to 100, getting the same number twice in ten tries is quite normal.
  • Using this tool for passwords or security keys. Use a dedicated password generator for anything that protects an account.
  • Changing the range after seeing the result. Decide the minimum and maximum before you draw.

Last reviewed: 5 November 2026 by the YogiCalc team ยท How we calculate and verify ยท Spotted an error? Tell us

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.

Is each number equally likely?

Yes. Every whole number between your minimum and maximum, including both ends, has the same chance of being chosen on each draw.

Can I use this to pick a lucky-draw winner?

Yes, for informal draws. Number the entries, set the range to match, and generate once per prize. For draws with legal or prize-money rules, follow the specific rules that apply to your contest.