Random Number Generator

Random Number Generator Guide

This tool draws integers from a range you set: a minimum, a maximum, and how many values you want, with optional unique and sorted results. Two ideas explain every surprise users run into — how many values the range actually contains, and how quickly repeats appear once you draw more than a handful. Both are easy to compute in advance, and both are shown below.

Inclusive Range and Value Count

The range is inclusive, so the number of possible values is max − min + 1, not max − min. That off-by-one matters most on small ranges.

Possible values for common ranges
RangePossible valuesTypical use
1 to 66Die roll
1 to 1010Quick pick
0 to 910Digit drawing
1 to 5252Card deck
1 to 100 (default)100Percentage-style draw
−50 to 50101Signed offsets, note the odd count
1 to 10001000Lottery-style numbering
1 to 1000010000Large pool sampling

Collision Probability: the Birthday Rule

Drawing with replacement means a value can appear twice. The chance of at least one repeat climbs far faster than intuition suggests: with 100 possible values, 10 draws already collide more than a third of the time.

Probability of at least one repeat (drawing with replacement)
DrawsRange of 10Range of 100Range of 365Range of 1000
569.8%9.7%2.7%1.0%
10100.0%37.2%11.7%4.4%
15100.0%66.9%25.3%10.0%
20100.0%87.0%41.1%17.4%
23100.0%93.6%50.7%22.5%
30100.0%99.2%70.6%35.6%
50100.0%100.0%97.0%71.2%

Note: with only 10 possible values, 10 draws are guaranteed to repeat. That is why small ranges need the unique option whenever repeats would spoil the draw.

Unique Mode: Sampling Without Replacement

Ticking unique removes each drawn value from the pool, so repeats become impossible. The cost is a hard ceiling: you cannot draw more unique values than the range contains.

Maximum unique draws per range
RangeMaximum unique drawsWhat happens beyond the limit
1 to 66Request is impossible; reduce the count
1 to 1010Request is impossible; reduce the count
1 to 5252Request is impossible; reduce the count
1 to 100 (default)100Request is impossible; reduce the count
1 to 10001000Request is impossible; reduce the count

Choosing a Range That Fits the Job

Picking a range is mostly a question of how many distinct outcomes you need. Classroom draws work well at 1 to 30, where every value stays readable on one screen; raffles usually want 1 to 1000, which leaves room without becoming unwieldy. When you are simulating a physical object, match it exactly — 6 for a die, 52 for a deck — so the behaviour matches what people expect from the real thing. If the result feeds a later step, choose a range whose size divides evenly by the number of groups you need, so no leftover values have to be discarded. And remember that unique mode changes the model: it removes each drawn value from the pool, which is the right choice for assigning distinct items and the wrong one for modelling independent events.

Worked Examples

All three use the tool defaults — minimum 1, maximum 100, one value — so you can reproduce them without changing a setting.

  1. Single draw: one value from 1 to 100 gives each number a 1.00% chance. Nothing else is assumed about the distribution.
  2. Ten draws with replacement: the chance that at least one value appears twice is 37.18%. If you need ten distinct numbers, tick unique rather than drawing again and hoping.
  3. Exhausting a range: with unique ticked, drawing 100 values from 1 to 100 returns every number exactly once — a permutation, not a set of independent draws.

Practical Notes

Frequently Asked Questions

Why is the range inclusive? Most drawing tasks expect both endpoints to be possible, so 1 to 100 contains 100 values. If you need 99, set the maximum to 99.

Why do I see repeats so often? Collision probability grows quickly with the number of draws: ten draws from 100 values already repeat 37.18% of the time. Use unique mode when duplicates are unacceptable.

What is the largest count I can request in unique mode? The number of values in the range. Asking for more than that is impossible rather than merely slow.

Does sorting make the draw fairer? No. Sorting reorders the same values for readability; the fairness of the draw is unaffected.

Can I use this for passwords or tokens? This tool is built for drawing and sampling. For secrets, use the generator that draws from the platform cryptographic source.

Related Reading

For the mathematics behind repeats and sampling, see our randomness guide. When the goal is a secret rather than a number, use the Password Generator; to publish a drawn result, the QR Code Generator turns it into a scannable code.