Random Number Generator
Generate random numbers between a minimum and maximum. Choose how many, allow decimals, force unique values and sort the result.
Generate random numbers between a minimum and maximum. Choose how many, allow decimals, force unique values and sort the result.
Pick a range and how many numbers you need. The generator uses your browser's cryptographic random source, so results are unbiased.
It can allow decimals, make every number unique, and sort the list.
Browsers offer two sources of randomness. Math.random is a fast pseudo random generator that is not intended for security, and its sequence can be predictable. The crypto.getRandomValues function draws from the operating system's cryptographically secure source, which is suitable for draws and tokens. A common mistake when mapping random bytes onto a range is modulo bias: taking a random 32 bit value modulo the range size slightly favours smaller results when the range does not divide evenly into two to the power of 32. Careful implementations reject values from the uneven tail and draw again to keep every outcome equally likely.
Unique mode is conceptually a draw without replacement, like pulling numbered tickets from a hat. It requires the range to contain at least as many distinct values as requested, which is why asking for more than exist is an error. Decimal output scales a random fraction into the range and rounds to the chosen places, so very small steps can produce repeated values. Randomness has no memory: a number that has just appeared is neither more nor less likely to appear again, and streaks, such as the same value twice in a row, are normal in genuinely random data.
They come from crypto.getRandomValues, which is suitable for most uses, including draws.
Yes, minimum and maximum can both appear.
You asked for more numbers than there are different values in the range.
No. They are generated in your browser and not saved.
No. The generator uses the browser's secure random source, which cannot be seeded. If you need reproducible sequences for testing, use a seeded pseudo random generator in your code.
Yes, the draw is unbiased, but fairness also depends on the process. Number your entries clearly, set the range to match them, and record the settings so others can check.