Random Number Generator
Generate truly random integers in any range, with options for unique values and sorting.
Random Number Generator
Generate truly random integers in any range, with options for unique values and sorting.
How to use the Random Number Generator
- Enter the minimum and maximum values.
- Enter how many numbers to generate.
- Optionally check "unique" and "sort".
- Click Calculate for new random numbers.
Formula
Uses the browser's crypto.getRandomValues() API for secure randomness.
Example
Generate 5 unique numbers between 1 and 50, sorted: 3, 17, 28, 34, 49
Step-by-step calculation
- Set range: 1 to 50.
- Count: 5 unique values.
- Browser generates 5 cryptographically random integers.
- Results sorted in ascending order.
Real-world uses
- Lottery and raffle selection.
- Scientific sampling.
- Game randomization.
Common mistakes
- Requesting more unique numbers than the range allows (e.g., 51 unique numbers in 1–50).
- Using predictable methods when security matters.
- Confusing pseudo-random with cryptographically secure random.
Frequently asked questions
Is this truly random?
It uses your browser's cryptographic random number generator, which is suitable for security-sensitive applications.
What is the maximum range?
The range (max − min + 1) can be up to about 2 billion.
Can I get the same numbers again?
Each calculation generates fresh random numbers. You cannot reproduce the same set.