How to use the Random number generator
- 1Set the minimum and maximum. Both ends are included, so 1 to 6 can return 1 or 6.
- 2Choose how many numbers to generate, from 1 to 1,000.
- 3Pick integers or decimals; for decimals, set 1 to 10 decimal places.
- 4Tick No duplicates if each number may appear only once, and Sort to order the results. Generate, then copy the list.
How it works
Random values come from crypto.getRandomValues, which draws on the operating system's secure random number generator. The same source is used to create encryption keys, so its output cannot practically be predicted from previous results.
Turning raw random bits into a number in your range needs care. The common shortcut of taking the remainder after division (modulo) makes some numbers slightly more likely whenever the range does not divide evenly into the generator's output. This tool uses rejection sampling instead: any raw value that would cause that imbalance is discarded and a fresh one drawn, so every number in the range is exactly equally likely.
With No duplicates on, the draw works like pulling numbers from a hat without putting them back. The range must therefore contain at least as many possible values as you ask for; 10 unique numbers cannot come from 1 to 5, and the tool will tell you so.
Formulas
P = 1 ÷ (Max − Min + 1)P(repeat) = 1 − (N × (N − 1) × … × (N − k + 1)) ÷ Nᵏ- N
- number of possible values in the range
- k
- how many numbers you draw
Worked examples
Draw 3 raffle winners from 250 tickets
- 1Min 1, max 250, count 3, No duplicates on
- 2Each ticket has a 3 ÷ 250 = 1.2% chance of being among the winners
Three different ticket numbers, for example 17, 142 and 203.
Roll two six-sided dice
- 1Min 1, max 6, count 2, duplicates allowed
- 2Each die: P = 1 ÷ 6 ≈ 16.7% for any face
Two independent rolls; doubles happen about 1 time in 6.
Why repeats show up sooner than expected
- 1Draw 10 numbers from 1 to 100 with duplicates allowed
- 2P(no repeat) = (100 × 99 × … × 91) ÷ 100¹⁰ ≈ 0.628
- 3P(at least one repeat) ≈ 1 − 0.628 = 0.372
About a 37% chance of a repeat, which is why the No duplicates option exists.
Is this random number generator truly random?
It uses a cryptographically secure pseudo-random number generator, seeded by your operating system from unpredictable hardware events. That is not the same as a physical process like radioactive decay, but for any practical purpose the output is unpredictable and evenly distributed. It is far stronger than Math.random, which is fine for animations but not designed for fairness or security.
It is suitable for games, classroom activities, raffles among friends, giveaways and random sampling. It is not a certified random number generator, so it should not be used for regulated gambling or official lotteries, which require audited hardware and procedures.
How do I run a fair giveaway draw?
- Number your entries in a fixed list, such as a spreadsheet, before generating anything.
- Announce the range and the number of winners in advance.
- Generate once with No duplicates on, and record or screenshot the result with a timestamp.
- Match each winning number to the entry in that position of your list.
Frequently asked questions
Are the minimum and maximum included?
Yes. Both ends of the range can be drawn, for integers and decimals alike.
Can I generate negative numbers?
Yes. Set a negative minimum, for example −50 to 50.
How do decimal results work?
Values are spread evenly across the range and given to the number of decimal places you choose, from 1 to 10. For example, 0 to 1 with two places returns results such as 0.37 or 0.82.
Can the same result come up twice in a row?
Yes, if duplicates are allowed. Each draw is independent, so a streak does not make a number more or less likely next time.
Are my results stored or sent anywhere?
No. Numbers are generated in your browser and disappear when you leave the page, so keep a copy if you need a record of a draw.