Random Number Generator
Pick random integers or decimals between any two limits.
How to use the Random Number Generator
- Pick what you want to work out using the tabs: Whole numbers or Decimals.
- Enter Lower limit.
- Enter Upper limit.
- Enter How many numbers.
- Tick Allow duplicates.
- Tick Sort results (smallest first).
- Read your answer in the results panel. It updates as you type, and the breakdown, step-by-step working and any charts or tables appear below it.
- Use Share link to save or send the exact calculation, or Copy to paste the results elsewhere.
How the generator works
Each number is drawn with crypto.getRandomValues, the same source of randomness browsers use for encryption keys. It is far less predictable than the ordinary Math.random function found in many online tools. Nothing is sent to a server: the numbers are created on your device.
For whole numbers, the generator uses rejection sampling so that every value in the range has exactly the same chance. A naive approach that takes a big random number modulo the range size slightly favours small values; rejecting the uneven tail avoids that bias.
Duplicates or no duplicates?
- Allow duplicates is like rolling a die repeatedly: each draw is independent and the same number can appear twice.
- No duplicates is like drawing raffle tickets from a hat without putting them back. Use it for lottery-style picks, choosing winners or assigning unique IDs. You cannot ask for more unique numbers than the range contains, so drawing 6 unique numbers from 1 to 5 is impossible.
When duplicates are not allowed and you ask for most of the range, the tool shuffles the whole range with a Fisher–Yates shuffle and keeps the first numbers. For a few numbers from a huge range it simply redraws whenever a repeat turns up.
Random decimals
The decimal mode builds a uniform value between 0 and 1 from 53 random bits (the full precision of a JavaScript number), scales it to your range and rounds it to the number of decimal places you choose. Rounding means the exact upper limit can occasionally appear.
Examples
- Lottery pick: 6 numbers from 1 to 49, no duplicates, sorted.
- Coin toss: 1 number from 0 to 1 (0 = heads, 1 = tails).
- Simulated measurements: 50 decimals between 9.5 and 10.5 with 2 decimal places.
Is it truly random?
Computer randomness is pseudo-random: an algorithm expands a secret seed gathered from unpredictable hardware events. Cryptographic generators are designed so that no one can predict the next output, which is more than good enough for games, sampling and draws. For regulated lotteries or gambling, follow whatever certified process your jurisdiction requires.
Frequently asked questions
How do I pick random numbers without repeats?
Untick “Allow duplicates”. Each number can then appear only once, like drawing tickets from a hat. The count cannot exceed the number of values in the range.
Are these numbers really random?
They come from your browser’s cryptographically secure generator, which is unpredictable for all practical purposes. Strictly speaking, all computer random numbers are pseudo-random.
Does every number have the same chance?
Yes. The generator uses rejection sampling, so each whole number in the range is equally likely. There is no bias towards low or high values.
Why do the numbers change when I edit a field?
A fresh set is drawn every time the inputs change or you press Generate. Copy the result if you need to keep it.