Skip to content
vladier

Random Number Generator

Set a range and generate one or many random numbers.

How to generate random numbers

  1. Type the smallest number you want in Min and the largest in Max. Both are included, so 1 to 10 can give 1 or 10.
  2. Set How many numbers you want, from 1 up to 10,000.
  3. Untick Allow repeats if every number must be different. Tick Sort results to list them from smallest to largest.
  4. Press Generate or hit Enter in any box. Your last results are kept in the history list below.

The preset buttons fill in common ranges in one tap: 1 to 10, 1 to 100, 1 to 1000, and a lottery style draw of 6 different numbers from 1 to 49.

Repeats or no repeats?

Think of a bag of numbered balls. With repeats allowed, you put each ball back after drawing it, so it can come up again. Rolling a die several times works this way. With repeats off, drawn balls stay out, which is what you want for raffle tickets, picking students by number, or assigning seats.

Without repeats you cannot ask for more numbers than the range holds. From 1 to 10 there are only 10 different numbers, so asking for 11 shows a message instead of a result.

Duplicates happen sooner than you think

With repeats allowed, matches show up surprisingly fast. This is the same math as the well known birthday problem: in a group of just 23 people, the chance that two share a birthday is just over 50%. In the same way, drawing 23 numbers from 1 to 365 gives a better than even chance of at least one repeat. If repeats would spoil your result, turn them off.

What the odds look like

RangeChance of any one number
1 to 101 in 10 (10%)
1 to 1001 in 100 (1%)
1 to 10001 in 1,000 (0.1%)
6 different numbers from 1 to 491 in 13,983,816 for one exact set

Every number in the range has the same chance on every draw. A number that just came up is no more and no less likely next time.

How it works

The generator uses your browser’s cryptographic random source, then maps the result to your range with rejection sampling. That step throws away the few raw values that would make some numbers slightly more common than others, a flaw known as modulo bias. Very wide ranges, such as 1 to 1 trillion, are handled exactly the same way. Everything runs on your device, and no numbers are sent anywhere.

Ideas

  • Pick a raffle winner by ticket number.
  • Choose a random page, question or exercise to review.
  • Settle who goes first: everyone guesses, closest number wins.
  • Make up practice math problems.

For tabletop games, the Dice Roller shows real dice faces and adds totals for you. For a quick two-way choice, flip a coin.

Questions

Is this random number generator truly random?

It uses your browser’s cryptographic random number generator (crypto.getRandomValues), which is designed for security uses and is far less predictable than ordinary random functions. The result is mapped to your range without bias, so every number has the same chance.

What does "allow repeats" mean?

With repeats allowed, each number is drawn independently, so the same number can come up more than once. With repeats off, every number in the result is different, like drawing numbered balls from a bag without putting them back.

How big can the range be?

Min and max can be any whole numbers, including negatives, as long as the gap between them stays below about 9 quadrillion (2 to the power of 53). You can generate up to 10,000 numbers at once.

Can I use it for a lottery or raffle?

You can use it to pick numbers or raffle winners for fun. It cannot predict any lottery draw, because real draws are random and every combination is equally likely.