Random Number Generator
Set a range, choose how many numbers, and generate — with cryptographic randomness.
How to use
- Set the minimum and maximum of your range (both included).
- Choose how many numbers to generate, and whether the same number may appear twice.
- Press Generate. Press again any time for a fresh set.
Examples
Dice roll
Min 1, max 6, count 1 — a fair six-sided die. Set count to 2 for a pair of dice.
Lottery numbers
Min 1, max 45, count 6 with duplicates off gives six distinct lotto-style numbers.
Random PIN candidates
Min 0, max 9, count 4 with duplicates on produces four digits you can join into a PIN.
FAQ
How random are the numbers?
They come from the browser’s cryptographic random generator (crypto.getRandomValues) with rejection sampling, so every value in the range has an exactly equal chance — better than the typical Math.random() approach.
Are min and max included in the results?
Yes, the range is inclusive on both ends: 1 to 10 can produce both 1 and 10.
What does “allow duplicates” change?
With duplicates on, every draw is independent (like rolling a die repeatedly). With duplicates off, numbers are drawn without replacement (like lottery balls) — so the count cannot exceed the size of the range.
Can I use negative numbers?
Yes. Any whole-number range works, for example −50 to 50.