Random Number Generator

Pick random numbers between any two values — one or many, with or without repeats.

-

How it works

Numbers come from your browser’s cryptographically secure generator (crypto.getRandomValues), with a correction that keeps every value in the range equally likely. Turn on No repeats to draw without replacement, which is what you need for raffles, lottery-style picks and assigning unique numbers.

Handy ranges

Set 1–6 for a die, 1–10 or 1–100 for a quick pick, 1–45 with six numbers and no repeats for a lottery-style draw, or 0–1 for a coin flip.

FAQ

Are the numbers truly random?

They are cryptographically strong and unbiased, which is far better than the generators most programming languages use by default.

Is the end value included?

Yes. Both the From and To values can be drawn.

Why can’t I pick more numbers than the range holds?

With No repeats on, a range of 1–10 has only ten distinct values, so you can draw at most ten.

Using the generator

  1. Type the lowest and highest value in From and To. Both ends can be drawn. If you enter them the wrong way round, the tool swaps them for you.
  2. Set How many numbers you want, from 1 to 1000.
  3. Tick No repeats when every result must be different, Decimals (with 1 to 6 places) for fractional values, and Sort to list the results from smallest to largest.
  4. Press Generate. Copy puts the numbers on your clipboard as a comma-separated list.

How the numbers are chosen

Each draw starts with a 32-bit random value from the browser's crypto.getRandomValues. Turning that into a number in your range is the delicate part. A common shortcut is to take the remainder after dividing, but that slightly favours small results whenever the range does not divide evenly into 232 (4,294,967,296). For a range of 100 values, the total divides with a remainder of 96, so the first 96 outcomes would be a hair more likely than the last four. This tool avoids that: it throws away any raw value above the largest exact multiple of the range size and draws again. The discarded share is tiny, and in return every number in the range has precisely the same chance.

Drawing without repeats

With No repeats on and a range of up to 100,000 values, the tool lays out the whole list and performs a partial shuffle: for each position it swaps in a randomly chosen item from what remains. That is the standard way to deal cards, and it never needs to retry. For larger ranges it simply redraws any value it has already seen, which is fast because collisions are rare when the range is big compared with the count. If you ask for more numbers than the range can supply, for example 12 unique values between 1 and 10, the tool tells you how many distinct values exist rather than looping forever.

Decimals

For decimals the range is converted to whole steps. With two places, 0 to 1 becomes the 101 values 0.00, 0.01, up to 1.00, each equally likely, and the result is shown with exactly two digits, so 0.5 appears as 0.50. If you leave Decimals off, any fractions typed in From or To are rounded down before drawing. Negative ranges such as -50 to 50 work normally.

Examples

Common uses

Tips and limits

More questions

Is Sort changing which numbers are drawn?

No. The numbers are chosen first and only then arranged in ascending order, so sorting affects display but not the draw itself.

Why do I sometimes see the same number twice in a row?

Without No repeats, each value is drawn independently, so repeats happen at exactly the rate chance predicts. In a range of 10, any two consecutive draws match one time in ten.

Can I reproduce an earlier result with a seed?

No. The generator is deliberately unseeded, so the same settings give different results each time. That is what makes it suitable for fair draws, but it is not suitable for repeatable simulations.