๐ฒ Random Number Generator
Set your options and press "Generate"
Specify a minimum and maximum value, and this tool generates a set of random integers within that range. Use the "no duplicates" option for drawing unique numbers, like a lottery or bingo draw. Uses a cryptographically secure random number generator.
How to use
- Enter a minimum and maximum value.
- Enter how many numbers to generate, and check "No duplicates" if needed.
- Press "Generate" to see the random numbers.
How the calculation works
This tool generates 1 to 1000 random integers within a range you set (minimum to maximum, inclusive), using the browser's cryptographically secure random number generator (crypto.getRandomValues). Taking a random value modulo the range size would make some numbers very slightly more likely (modulo bias), so values in the uneven part of the range are discarded and redrawn. With "no duplicates" on: โข narrow ranges: every number in the range is listed, shuffled with the FisherโYates algorithm and taken from the front โข wide ranges: numbers are drawn one at a time and redrawn if already used, so ranges such as 1 to 1,000,000,000 never need listing
Worked example
5 numbers from 1โ100 (duplicates allowed): 42, 7, 88, 42, 15 (the same number can appear twice) 6 from 1โ43 without duplicates: Loto 6 numbers 1 from 1โ6: a die roll Without duplicates you cannot request more numbers than the range holds (20 from 1โ10, for example).
Things to be aware of
- A cryptographic generator is used so results are fit for fair draws and ordering.
- Numbers generated without duplicates come out in random order; sort them afterwards if you want them in sequence.
- Numbers are generated in your browser and never sent anywhere.
FAQ
What does "No duplicates" do?
It ensures the same number never appears more than once. If the count you request exceeds the total number of integers in the range, you'll get an error.
Is there a limit on how many numbers I can generate?
Yes, up to 1000 numbers per generation, to keep the browser responsive.
How secure is the randomness used?
It uses a cryptographically secure random number generator (crypto.getRandomValues) instead of Math.random(), suitable for drawings and cryptographic uses.