Random Number Generator

SourceClassPredictable?Right for
Math.random()PRNG (V8: xorshift128+)Yes - seeded and observableGames, demos, non-security sampling
crypto.getRandomValues()CSPRNG fed by OS entropyNo practical predictionLotteries, tokens, this page's draws
Hardware DRBG / TRNGValidated against NIST failure testsCertified classSecurity products, key generation
Uses your browser's cryptographically secure random source — nothing recorded. The security grade of a random source is defined in NIST SP 800-90A Rev. 1 - this page draws from the browser's cryptographic provider, the middle row, not from Math.random.

Pick random numbers in any range — for prize draws, raffle winners, picking who goes first, sampling, or games. Choose whole numbers or decimals, allow or ban duplicates, and generate up to 100 at once. Results come from your browser's WebCrypto cryptographically secure random source, not a predictable pseudo-random shortcut.

Fairness matters when a draw has real consequences. Cryptographic randomness is the same class of generator used for security keys, so every number in the range is equally likely and impossible to predict in advance — even by this page.

How to use

  1. Set the minimum and maximum of your range — anything from -1,000,000 to 1,000,000.
  2. Choose how many numbers you need, and toggle whole-numbers-only or no-duplicates as you prefer.
  3. Hit Generate — results appear instantly; generate again for a fresh set.

Worked examples

The 100-entry raffle

Number the entries 1 to 100, set the range to match, request 3 winners with no-duplicates on - the tool then cannot hand the same entry two prizes, which is the property a raffle actually needs. With duplicates left on, the same number could repeat: fine for simulations, a dispute waiting to happen for prizes.

The off-by-one range check

A range from -5 to 5 holds 11 numbers, not 10: both endpoints are included, so the size is always max - min + 1. The same check sizes fair draws - 1 to 49 is 49 outcomes, 0 to 99 is 100 - and getting it wrong quietly biases every probability you compute about the draw.

Ten samples from a hundred

With duplicates on, ten draws from 1 to 100 come back all-different about 62.8% of the time (100P10 / 100^10); the no-repeats mode guarantees it and the number of possible winner sets becomes C(100,10) = 17,310,309,456,440. Every one of those sets was equally likely before the first draw - the definition of a fair sample.

Frequently asked questions

Is this random number generator truly random?

It uses the browser's WebCrypto API — a cryptographically secure random source seeded by your operating system. This is the same quality of randomness used for encryption keys, which is far stronger than typical Math.random() generators.

Can I use it for a raffle or prize draw?

Yes. Set the range to your number of entries, turn on 'no duplicates' if you are picking multiple winners, and generate. The cryptographic source makes the draw fair and verifiable.

How do I generate a number between 1 and 100?

Set minimum to 1, maximum to 100, count to 1, keep 'whole numbers only' on, and press Generate. Both endpoints of the range are included.

What happens if duplicates are off and the range is too small?

You cannot pick 50 unique numbers from a 10-number range, so the tool shows a clear message instead of looping forever. Turn duplicates on or widen the range.

Is Math.random() truly random?

No - and the difference matters once anything valuable rides on the outcome. Math.random() is a pseudo-random number generator: a deterministic algorithm (V8 uses xorshift128+) seeded once per process, producing a sequence that is uniform enough for games and demos but seeded, observable, and in principle reproducible. The browser's crypto.getRandomValues() draws from the operating system's entropy pool instead - the cryptographic class defined in NIST SP 800-90A. This page uses the cryptographic provider for every draw, which is why the no-duplicates mode is safe for raffles and the sequence is not reproducible by anyone.

Can anyone predict the numbers this page produces?

Not from anything observable. The random bytes come from the operating system's entropy pool through the Web Crypto API inside your browser; they are not sent anywhere, logged, or derived from the time. A past draw gives zero information about the next one - each draw is independent, so a number that just came up has exactly the same chance as any other. That property is the whole security definition of a cryptographic random source, and it is what separates a fair raffle from a shuffled-looking sequence.

Are the numbers evenly spread across the range?

Each draw gives every number in the range an identical chance - that is what uniform means - but uniform is about odds, not about short-run balance: a handful of draws can cluster, and that is correct behavior. Over many draws the counts converge toward equal shares, and the cryptographic source is what keeps any cell from being systematically favored.

Can I use decimal ranges, like 0 to 1?

Yes - turn whole-numbers-only off and the draw covers the range continuously, which is how you get random coordinates, random delays or Monte Carlo inputs: 0 to 1 gives a uniform point on the unit interval, and scaling or shifting maps it anywhere. The uniform distribution is the primitive every other random shape gets built from.

Related tools