Random Number Generator

Pick fair random whole numbers, with or without repeats.

Up to 1,000 at once.

Quick picks

Random result

74

Your random number from 1 to 100 is 74.

Chance of each number
1 in 100 (1%)

Min and max are included. Each press of Generate draws fresh numbers in your browser.

Fix the highlighted field to update the result.

How to use

  1. Enter the min and max. Both ends can come up.
  2. Choose how many numbers you want, up to 1,000.
  3. Choose No repeats for unique numbers, like drawing raffle tickets.
  4. Press Generate for a fresh draw. The quick picks set up a die, a coin or a lottery draw.

How the fairness works

  1. Your browser’s secure generator, crypto.getRandomValues, supplies 32 random bits: a number from 0 to 4,294,967,295.
  2. We need a number from a range of n values. Taking the remainder after dividing by n would favour small numbers whenever n doesn’t divide 2³² evenly.
  3. So we discard any draw at or above the largest multiple of n and draw again. This is the “simple discard method” in NIST SP 800-90A.
  4. Every number in your range then has exactly the same chance: 1 in n.

Examples

  • 1 to 100: each number has a 1 in 100 (1%) chance. Only 96 of the 4,294,967,296 possible draws are discarded.
  • Lottery, 6 from 1 to 49 with no repeats: there are 13,983,816 possible sets.
  • A die (1 to 6): each face has a 1 in 6 chance.

Why discarding matters

Imagine a generator that only made 3 bits (0 to 7) and we wanted a die. Using the remainder after dividing by 6, faces 1 and 2 would come up twice as often as the others:

Face Draws that give it Chance
1 0, 6 2 in 8
2 1, 7 2 in 8
3 2 1 in 8
4 3 1 in 8
5 4 1 in 8
6 5 1 in 8

Discarding 6 and 7 makes every face 1 in 6.

How "no repeats" works, and what not to use it for

For unique numbers we shuffle the range part-way (a Fisher–Yates shuffle) or, for huge ranges, simply redraw any repeat. Both keep every possible set equally likely.

Don’t use this page for passwords or keys: results appear on screen and in your recent calculations.

Want to summarise a list of draws? Paste them into the average calculator.

Frequently asked questions

Is this random number generator truly random?

It uses your browser’s cryptographically secure generator (crypto.getRandomValues). It is not physical noise, but it is unpredictable and fair enough for draws, games and sampling.

How do I get random numbers without repeats?

Set Repeats to “No repeats”. Each number can then appear only once, like drawing balls from a bag. You can’t ask for more numbers than the range holds.

What are the chances of each number?

Every whole number in the range is equally likely: 1 in (max − min + 1). For 1 to 100 that is 1 in 100, or 1%.

Are the minimum and maximum included?

Yes. Both ends are possible results, so a range of 1 to 6 works like a die.

Why not just use the remainder (modulo) of a random number?

A plain remainder favours small numbers unless the range divides the generator’s size evenly. We discard the few draws that would cause that bias, so every number has the same chance.

Can I use this for passwords or cryptographic keys?

No. The source is secure, but results show on screen and are saved in your recent calculations. Use a password manager for secrets.

Embed this calculator

Add this calculator to your own website for free. Copy the code below and paste it into your page’s HTML. The attribution link is optional.