# Random Number Generator

> Pick one or up to 1,000 random whole numbers between any two limits, with or without repeats, using your browser’s cryptographic random source.

Category: Mathematics · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/random-number-generator

Set the lowest and highest number and how many you need. Every whole number in the range is equally likely on every draw.

Also called: Random number picker, RNG.

## Inputs
- Lowest number (default 1)
- Highest number (default 100)
- How many numbers (default 1)
- Allow repeats? (options: Repeats allowed, No repeats; default no)

## Results
- Your random numbers
- Whole numbers in the range
- Chance of any one number on a draw

## Formula

```
Number = Lowest + U, where U is a uniform random integer from 0 to (Highest − Lowest), drawn by rejection sampling from crypto.getRandomValues
```

Where:
- Lowest, Highest: the inclusive limits
- U: an unbiased random offset

## Worked example
1. There are 100 − 1 + 1 = 100 whole numbers from 1 to 100.
2. Each is equally likely: 1 ÷ 100 = 1% per draw.
3. A random offset from 0 to 99 is added to 1 to give the number.

**Result:** Each number from 1 to 100 has exactly a 1% chance of being picked.

## What the result means

Use “No repeats” for raffles, seating plans or picking several winners, so nobody is drawn twice. Use “Repeats allowed” to simulate dice or independent draws.

## Assumptions and limits
- Both limits are included and must be whole numbers between −1,000,000,000 and 1,000,000,000.
- Numbers are generated in your browser and are not recorded, so a draw cannot be audited or reproduced later. For regulated lotteries, use an audited process.

## Questions

### Are these numbers really random?

They come from the browser’s cryptographically secure generator (the same source used for encryption keys), and rejection sampling ensures no number in the range is favoured.

### Why did I get the same number twice?

With repeats allowed, each draw is independent, so repeats are normal: among 23 draws from 1 to 365 there is already a better than even chance of a repeat.

## Related calculators
- [Probability Calculator](https://calculators.geekmidst.com/calculators/probability-calculator)
- [Permutation and Combination Calculator](https://calculators.geekmidst.com/calculators/permutation-and-combination-calculator)
- [Statistics Calculator](https://calculators.geekmidst.com/calculators/statistics-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/random-number-generator
