How to use the random number generator
- Choose Integers for whole numbers, or Decimals for numbers with a fixed number of decimal places.
- Enter the minimum and maximum. Both are included in the range.
- Enter how many numbers you want, from 1 to 1,000.
- For integers, choose whether duplicates are allowed. For decimals, choose the number of decimal places (1 to 10).
- Press Generate. Each press gives a new, independent set.
When you ask for up to ten numbers, they are listed together with a sorted copy. Larger batches appear in a numbered table below the result, and you can copy them into a spreadsheet.
How the numbers are made fair
A simple way to get a number from 1 to 100 is to take a random 32-bit value and keep the remainder after dividing by 100. That method is subtly unfair. 2³² = 4,294,967,296 is not a multiple of 100, so the first 96 remainders get one extra chance each. This is called modulo bias.
This generator uses rejection sampling instead. It works out the largest multiple of the range that fits in 2³². Here that is 4,294,967,200. Any raw value at or above that limit is thrown away and a new one is drawn. The values that remain divide evenly, so every outcome has exactly the same probability. For ranges wider than 2³² it draws 53 random bits and applies the same rule.
Decimals use the same method. A range of 0 to 1 with 2 decimal places has 101 equally likely outcomes: 0.00, 0.01, … 1.00. The generator picks one of those whole-number steps and then divides by 100, so the decimals never drift.
Worked example
With the defaults (integers, minimum 1, maximum 100, one number), the range holds 100 equally likely values. Each number has a 1 in 100 chance, or 1%, on every press. The chance of getting the same number twice in a row is also 1 in 100. Earlier results have no effect on the next one.
Now ask for 6 unique numbers from 1 to 49. Each time a number repeats, it is redrawn until all six are different. The number of possible sets is 49 × 48 × 47 × 46 × 45 × 44 ÷ 6! = 13,983,816, and every one of them is equally likely.
When to allow duplicates
- Allow duplicates for independent events, such as rolling dice, simulating coin flips or picking a random test value each time.
- No duplicates for draws without replacement, such as raffle tickets, assigning people to groups, picking a random sample of rows, or shuffling a playlist. If you ask for more unique numbers than the range contains, you will see a message, because it cannot be done.
Limitations
- The minimum and maximum must lie within ±10¹⁵, so every whole number in the range can be stored exactly.
- Non-integer limits are rounded inward in integer mode, so 0.5 to 10.2 means 1 to 10.
- This is a convenience tool, not a certified draw system. For regulated lotteries or legal drawings, follow the rules that apply to you.
Frequently asked questions
Are these numbers truly random?
They come from your browser's cryptographically secure generator, crypto.getRandomValues. Your operating system seeds it from hardware sources of unpredictability. It is the same source browsers use for encryption keys, and it is far less predictable than Math.random.
How do I pick lottery-style numbers with no repeats?
Choose Integers, set the minimum and maximum, enter how many numbers you need, and select "No (all unique)". For example, 6 unique numbers from 1 to 49 gives a draw in which no number appears twice.
Is the maximum included?
Yes. Both ends of the range are included. A range of 1 to 6 works like a die, and each face has a one-in-six chance.
Are my numbers stored anywhere?
No. Everything is generated on your own device and nothing is sent to a server. Pressing Generate again gives a fresh, independent result.
Last reviewed: