How to use the random number generator
- Enter the minimum and maximum. Both ends are included, so 1 to 6 can produce 1 and 6.
- Choose how many numbers you want. Set decimal places to 0 for whole numbers, or up to 6 for decimals.
- Tick No duplicates if every number must be different. Pick an order and a separator for the list.
- Press Generate. Press Generate again for a fresh draw, and Copy results to put them on your clipboard.
Why the numbers are unbiased
The tool uses the secure random generator built into your browser (the Web Crypto function getRandomValues), not the weaker Math.random. To turn random bits into a number in a range, it uses rejection sampling. A naive approach takes a 32-bit random value and applies the remainder operator, which slightly favors the low numbers whenever the range does not divide 2^32 evenly. Here, the generator throws away any draw above the largest exact multiple of the range and draws again.
For a six sided die, 2^32 = 4,294,967,296 leaves a remainder of 4 when divided by 6, so the largest exact multiple is 4,294,967,292 and only four of the more than four billion possible draws are ever rejected. Every face is then exactly equally likely. Ranges above 2^32 use 64 bits in the same way. The automated tests for this page run a chi-square check on tens of thousands of draws to confirm the spread is even.
Whole numbers and decimals
With decimals, the range is placed on a grid. Between 0.5 and 2 with 2 decimal places, the possible values are 0.50, 0.51 and so on up to 2.00, which is 151 values, and each is equally likely. If a limit is not on the grid, the range shrinks inward to the nearest grid value. A minimum of 0.15 with one decimal place starts at 0.2, never 0.1. The numbers are produced as whole numbers on the grid and formatted exactly, so you never see floating point noise such as 0.30000000000000004.
No duplicates and the count limit
When duplicates are not allowed, the tool draws distinct values with Floyd's algorithm and then shuffles them, so even a range of a quadrillion values uses almost no memory. You cannot ask for more different numbers than the range holds. Asking for 101 different whole numbers between 1 and 100 shows an error that says only 100 values are possible, and the tool does not guess what you meant. You can request up to 10,000 numbers at once.
Picking 6 different numbers from 1 to 49 can produce 13,983,816 different sets, which is the number of ways to choose 6 items out of 49. The generator makes no prediction about any real lottery. Each draw is independent of the last.
Privacy
Everything is generated in your browser. Nothing is stored, logged or uploaded, and the results disappear when you close the page.
Assumptions and limits
- Both the minimum and the maximum are included in the range.
- Ranges can span about 2 quadrillion values once decimal places are applied. Larger limits are rejected.
- Results are formatted with a dot as the decimal separator and no thousands separators, so they paste into other tools without changes.
- Random numbers are suitable for games, sampling, drawings and teaching. For passwords use the password generator.
- If your browser does not provide secure random values, the tool shows an error rather than falling back to a weaker source.
Frequently asked questions
Is this random number generator truly random?
It draws from the operating system backed secure random generator your browser exposes, which is designed to be unpredictable. That is stronger than the pseudo random function most simple generators use, and it is the same source used for cryptographic keys.
What does rejection sampling mean?
It means discarding the rare random draws that would make some results slightly more likely than others and drawing again. Without it, using a remainder on a random value gives a small but real bias toward the smaller numbers.
Why does it refuse my request for unique numbers?
You asked for more different numbers than fit in the range. Whole numbers from 1 to 10 hold only ten values, so eleven different ones are impossible. Widen the range, lower the count or allow duplicates.
Can I generate negative numbers or decimals?
Yes. Enter a negative minimum, such as -50, and set decimal places up to 6. Every value in the range, including both ends, has the same chance.
How do I choose a random person instead of a number?
Paste the names into the random name picker, which uses the same unbiased method to pick winners or build teams.