Guide

How to Pick Random Numbers in a Range (With or Without Repeats)

To pick a random whole number, set a minimum and maximum, then generate a result. A range from 1 to 10 includes both endpoints, so there are ten possible values. Use No repeats when you need distinct numbers within one generated batch.

Count the possible values first

For an inclusive whole-number range, the number of possibilities is maximum − minimum + 1. From 5 to 12, that is 12 − 5 + 1 = 8. Forgetting the +1 leaves out one endpoint.

Negative limits also work: −2 to 2 contains −2, −1, 0, 1, and 2. If both limits are 7, the only possible result is 7. The minimum must not be greater than the maximum.

Decimals define whole-number boundaries

This generator outputs integers, not random decimal fractions. It rounds the minimum up and the maximum down. A minimum of 1.2 and maximum of 4.8 therefore gives an integer range from 2 through 4.

If rounding leaves no whole numbers, the range is invalid. For example, 1.2 through 1.8 contains no integer. Use whole-number limits for the clearest result and a modest range for everyday choices.

What No repeats does

With No repeats selected, the generator keeps drawing until it has the requested number of distinct values. Asking for three numbers from 1 to 3 returns all three in some order. Asking for four is impossible and shows a range-too-small message.

Without No repeats, repeated draws can occur, but this tool still displays each value only once. That means the visible result may contain fewer numbers than requested. No repeats applies to one batch, not to every future click of Generate.

Random does not mean evenly spaced

A short sequence can cluster or include nearby values. Getting 4 followed by 5 is not evidence of a problem. Random choices do not have to look balanced in a small sample.

For a classroom exercise or an informal choice, assign one number to each option before generating. Changing the mapping after seeing the result undermines the selection. This tool does not keep an audit trail or enforce drawing rules.

Use it for everyday choices, not security

Set Min, Max, and How many, optionally select No repeats, and press Generate. The quantity is limited to 100. For an example, choose 1 to 10 and request three distinct values; every displayed value should be a whole number within those limits.

The tool uses JavaScript Math.random, which is pseudorandom and not cryptographically secure. Do not use it to create passwords, security tokens, or regulated prize drawings. Generation happens in your browser, but that alone does not make a draw certified or suitable for high-stakes use.

Try it yourself

Put this guide into practice with our free Random Number Generator — no sign-up, no download.

Open the Random Number Generator