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

  • Last updated
  • Formula tested against reference values

Your numbers

Up to 1,000.

Allow repeats?

Result

Your random numbers
—

Calculating…

Whole numbers in the range
—
Chance of any one number on a draw
—

How to use this calculator

  1. Enter or choose lowest number.
  2. Enter or choose highest number.
  3. Enter or choose how many numbers.
  4. Enter or choose allow repeats?.
  5. The your random numbers updates as you type. Use Copy result or Share to keep it.

Method

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

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.

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.