Skip to content

Random Number Generator

Pick random whole numbers between a minimum and a maximum, one at a time or up to 1,000 at once, with or without repeats. For the odds of an outcome rather than an actual draw, use the probability calculator.

From 1 to 1,000. Both the minimum and maximum can be drawn.

Repeats

Result

Range

1 to 100

Press Generate to draw a number.

Possible values
100
Chance of any one value per draw
1%
Show the working
  1. Possible values = maximum − minimum + 1100 − 1 + 1 = 100
  2. Chance of one particular value = 1 ÷ possible values1 ÷ 100 = 1%

Drawn in your browser with crypto.getRandomValues. Nothing is sent or stored. With No repeats, the chance applies to the first draw.

How to use the random number generator

  1. Enter the minimum and maximum. Both are included: 1 to 6 can give 1, 2, 3, 4, 5 or 6, like a die. Negative numbers work too.
  2. Choose how many numbers you want, from 1 to 1,000.
  3. Pick Allow repeats for independent draws, like rolling a die several times, or No repeats for a draw where each number can come up only once, like names from a hat or lottery balls. Without repeats you can’t draw more numbers than the range contains.
  4. Press Generate. Change any setting and the old draw is cleared, so the numbers on screen always belong to the settings shown.

Numbers are drawn only when you press the button, never while the page loads, and they stay in your browser. Choosing an order sorts the result for reading; it does not change which numbers were picked.

How the numbers are drawn

Every whole number in the range is equally likely on each draw:

n = max − min + 1, P(any one value) = 1 ÷ n

n
how many different values the range holds
P
the chance that a single draw gives one particular value

The generator asks the browser for random bits, forms a whole number x between 0 and 2⁵³ − 1, and reduces it to the range with the remainder of x ÷ n, then adds the minimum. Reducing with a remainder has a trap called modulo bias: unless 2⁵³ is an exact multiple of n, the last, incomplete block of values maps only onto the smallest results, which then come up slightly more often. To avoid it the generator uses rejection sampling: any x that falls in that incomplete block is thrown away and a new one is drawn. Every value in the range then has exactly the same chance.

For a draw without repeats and a range up to 100,000 values, the generator shuffles the range with the Fisher–Yates method and takes the first numbers; in larger ranges it draws and simply redraws the rare repeat. Both give every possible set of numbers the same chance.

Worked example

With the default range, 1 to 100, there are 100 − 1 + 1 = 100 possible values, so each has a 1% chance on any draw.

Why the bias matters: suppose a generator took one random byte (0 to 255) and used the remainder after dividing by 100. Since 256 = 2 × 100 + 56, the results 1 to 56 each have three bytes that lead to them and 57 to 100 only two. The low numbers would come up 3 in 256 times (about 1.17%) and the high ones 2 in 256 (about 0.78%). Rejecting bytes 200 to 255 and drawing again makes every result exactly 1%.

For a lottery-style pick of 6 different numbers from 1 to 49, set the range to 1–49, the count to 6, choose No repeats and Smallest first.

Pseudo-random or cryptographically secure?

Computers are deterministic, so almost all software randomness comes from an algorithm that stretches a small random seed into a long stream of numbers. That is a pseudo-random number generator. What differs is how predictable the stream is:

  • General-purpose generators, such as the one behind JavaScript’s Math.random, are fast and statistically well spread, but the language standard leaves the algorithm to each browser and makes no promise that the output can’t be predicted. Someone who sees enough outputs may be able to work out the rest.
  • Cryptographically secure generators, which the Web Cryptography API’s getRandomValues provides, are seeded from high-quality entropy such as the operating system’s and designed so that past outputs don’t reveal future ones. This is the kind of generator security software depends on.

This page uses getRandomValues for every draw. For a raffle among friends either kind would do; the secure one costs nothing extra here and removes a question.

Official lotteries, regulated gambling and scientific sampling often have their own requirements for audited equipment or documented procedures. A browser tool is fine for everyday picks, not as a substitute for those.

Limits

  • Only whole numbers. Minimum and maximum can each be up to one quadrillion (10¹⁵) in size, positive or negative.
  • Up to 1,000 numbers per draw. Without repeats, no more than the range holds.
  • “Random” doesn’t mean “evenly spread”: repeats and runs are normal. Ten draws from 1 to 10 with repeats will usually include at least one repeat. The probability calculator works out chances like that, and the average calculator summarises a list you’ve drawn.

Frequently asked questions

Are the minimum and maximum included?

Yes. The range is inclusive at both ends, so a range of 1 to 10 can produce 1 and 10, and each of the ten values has a 10% chance on every draw.

How do I pick numbers without repeats?

Choose No repeats. Each number can then appear only once, like drawing from a hat, and the count can’t be larger than the number of values in the range.

Is this random number generator truly random?

It uses your browser’s cryptographically secure generator, crypto.getRandomValues, which the Web Cryptography standard requires to produce cryptographically strong values, seeded from high-quality entropy such as the operating system’s. Like all software generators it is an algorithm, but its output can’t practically be predicted.

Why do I get the same number twice?

With Allow repeats, every draw is independent, so repeats are expected. Drawing ten numbers from 1 to 10 gives at least one repeat almost every time. Choose No repeats if each number should appear only once.

Can I use it to pick a raffle or giveaway winner?

Yes: number the entries from 1 to the total, set that as the range and draw one number, or several with No repeats for multiple winners. Check the rules of any official prize draw, which may require a specific procedure.

Sources

Last reviewed September 19, 2026