DiceDecide

Unique Random Number Generator

Be the first to rate this page.

Pick distinct integers from an inclusive range in your browser; a number cannot appear twice.

Selected numbers

The population is an inclusive integer range

This generator starts with every integer from the minimum through the maximum, including both endpoints. With minimum 12 and maximum 20, the population is 12, 13, 14, 15, 16, 17, 18, 19, 20: nine possible values, not eight. It then makes a random ordering and takes the requested number of positions. That procedure is sampling without replacement. Once 17 is in the result, it is no longer available for another position in that same run.

The count must therefore be no greater than max − min + 1. Asking for ten unique numbers from 1 through 9 is not a difficult draw with an unlucky outcome; it is mathematically impossible. The form reports that boundary instead of silently repeating a value or shrinking the request.

Why each subset has the same chance

A uniform shuffle of N distinct values has N! possible orders. Taking the first k positions gives every ordered k-tuple the same probability, 1 divided by N × (N−1) × … × (N−k+1). If order is ignored, every k-member subset has probability 1 divided by the binomial coefficient C(N,k). For six picks from 49 lottery-style numbers, that denominator is C(49,6) = 13,983,816.

The browser uses cryptographic random values where available and rejection sampling for bounded positions. Rejection matters because 2^32 is not divisible by every possible range size. Discarding the small tail before taking a remainder prevents a few early positions from receiving one extra raw value.

Worked draw: 6 values from 12 through 20

There are nine eligible integers. A possible shuffled order begins 17, 12, 20, 14, 16, 19, 13, 18, 15. With count 6, the displayed result is 17, 12, 20, 14, 16, 19. The omitted values are not failures; they are the remaining three positions in the shuffled population.

The chance that a particular number such as 17 appears somewhere in six picks is 6/9 = 2/3. Its chance of being the first displayed number is 1/9. Those are different questions. A result containing 17 does not imply that 17 was more likely than 15; each number had the same inclusion chance before the draw.

When no repeats are the rule

Use distinct draws for raffle ticket numbers, sample IDs, seat numbers, bingo calls, audit samples, or assigning a limited set of different prizes. The defining fact is that one selected item removes itself from the available population. Copy the result before refreshing if a record matters; the tool does not submit a draw to a server or make an official audit trail.

For a classroom exercise, state whether the endpoints are included and whether the list is a range or a set with missing values. Ticket numbers 100 through 110 do not describe issued tickets if 104 and 109 were never printed. In that case use a list-based draw with only eligible entries.

Common mistakes with ranges

The most frequent error is treating an upper endpoint as exclusive because many programming loops work that way. This page does not: 1 through 10 contains ten values. Negative bounds are valid too, so −3 through 3 contains seven values. Decimal inputs are rejected because a finite uniform selection of all real numbers between two decimals is a different mathematical object.

Another error is interpreting the displayed order as a ranking. Here order records the shuffled positions only. If you need one winner and then two alternates, decide that before drawing and read first, second, and third in order. If you only need a set, sort the copied values afterward without changing which values were drawn.

What makes it different

A normal random number generator can produce 4, 4, 8 because every trial is independent and replacement is allowed. This page cannot produce a duplicate within one result. A list shuffler orders every supplied label; this page selects a requested subset of consecutive integers. A lottery simulator estimates odds over many imaginary draws, while this tool performs one actual local selection.

No result proves that a range was fair in the real world. The browser cannot know whether every number represents an eligible person or whether a redraw was agreed in advance. It makes the stated sampling rule visible and applies it consistently.

Checking a draw before using it

Count the output, check that each number lies between the shown endpoints, and check that the count of a Set of values equals the requested count. Those three tests catch a missing endpoint, an out-of-range value, and a duplicate. For the example above, six displayed values, all from 12–20, with six distinct entries is a valid result.

Do not use a casual browser randomizer for passwords, cryptographic keys, regulated gambling, legal selection, or safety decisions. It is useful for transparent low-stakes allocation when the eligible population and the no-repeat rule have already been agreed.

Enter your values, review the result, then use it with confidence.

Rate this page

Be the first to rate this page.