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.

Please enter a valid value.

Please enter a valid value.

Please enter a valid value.

Result

How to use the Random Number Generator

  1. Enter the minimum and maximum values.
  2. Enter how many numbers to generate.
  3. Optionally check "unique" and "sort".
  4. 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

  1. Set range: 1 to 50.
  2. Count: 5 unique values.
  3. Browser generates 5 cryptographically random integers.
  4. 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.

More Math & Statistics calculators