Random number generator
Choose a minimum, a maximum and how many numbers you need, and this random number generator picks them fairly, with or without repeats.
Last updated Built and maintained by Rana Huzaifa
How to use the random number generator
- Enter the smallest and largest number you want, for example 1 and 100.
- Enter how many numbers you need, from 1 to 1,000.
- Tick No repeats if each number may appear only once, as in a raffle, and Sort if you want them in order.
- Press Generate, then Copy to paste the numbers elsewhere.
How the random number generator works
The numbers come from your browser's cryptographic random number generator, the same source used to create encryption keys. It is far less predictable than the simple random functions many websites use.
Turning a random value into a number in your range needs care. Taking the remainder after division makes some numbers slightly more likely than others, so the tool throws away the few values that would cause that bias and draws again. Every number in your range has exactly the same chance. With No repeats on, a number that has already been drawn is skipped, just like drawing tickets from a hat.
The probability
For a range from min to max there are max − min + 1 possible numbers, and each has a chance of 1 ÷ (max − min + 1) on every draw. From 1 to 100, each number has a 1% chance.
When drawing without repeats, the chance that a particular number is among k numbers drawn from N is k ÷ N.
Example
To pick a winner from 250 raffle tickets, enter 1 and 250 and generate one number. Each ticket has a 1 in 250 chance, or 0.4%.
To draw 6 different numbers from 1 to 49, enter 1, 49 and 6, and tick No repeats. Any one number has a 6 ÷ 49 chance, about 12.2%, of being drawn.
Tips and common mistakes
Be open about prize draws
For a public giveaway, decide the range and rules before you draw and record your screen while you generate the number.
Picking items from a list
Number your list, then generate a number in that range. To choose 3 people from 20, enter 1 to 20, ask for 3 and tick No repeats.
Need a password instead?
For a secure password, use the password generator, which mixes letters, numbers and symbols.
Turning results into percentages
Running a quick experiment? The percentage calculator shows how often an outcome came up as a share of all draws.
Frequently asked questions
Is it truly random?
It uses your browser's cryptographically secure generator, which is designed to be unpredictable and is suitable for draws, games and sampling.
Can I use negative numbers?
Yes. Any whole numbers between minus and plus one trillion work, for example −10 to 10.
Why can't I get more unique numbers than the range holds?
From 1 to 10 there are only 10 different numbers, so you can't draw 11 without repeats.
Can it predict lottery numbers?
No. Lottery draws are random, so no tool can predict them. It can pick numbers for you, and they are as likely as any others.