Skip to main content
Everyday Tools

Random Number Generator

Need a number for a draw, a game, a sample or a quick decision? Set a minimum and maximum, choose how many numbers you want and press Generate. You can ask for numbers with no repeats and have them sorted.

Last reviewed:

Numbers come from your browser's cryptographically secure random generator, with every value in the range equally likely.

How to use this calculator

  1. Enter the minimum and maximum numbers, both included in the range.
  2. Enter how many numbers you want.
  3. Tick No repeats for unique numbers, and Sort results if you want them in order.
  4. Press Generate. Use Copy numbers to copy them.

Formula and variables

Number = Minimum + random integer from 0 to (Maximum − Minimum)

  • Range size - Maximum − Minimum + 1, the count of possible values.
  • No repeats - each value can appear at most once, which needs a count no larger than the range size.

Values are picked without modulo bias, so each number in the range has the same chance.

Worked example

Draw 6 different numbers from 1 to 49.

Inputs and results for the worked example
Range1 to 49
Count6, no repeats
ResultSix different numbers, for example 4, 11, 19, 27, 38, 46
  1. The range holds 49 possible numbers.
  2. Each pick is chosen uniformly from the numbers not yet drawn.
  3. The six picks are shown, sorted if you ticked Sort.

What changes the result

  • Inclusive range. Both the minimum and the maximum can be drawn.
  • Repeats. Without the No repeats option, the same number can appear more than once, as with dice.
  • Whole numbers only. This tool generates integers. Decimals are not supported.
  • Not for gambling guarantees. Random numbers do not make a lottery ticket more likely to win.

Benefits and practical uses

  • Fair, unbiased picks for draws and games.
  • Unique numbers for raffles and samples.
  • Nothing is stored or sent.

Assumptions and limitations

  • Range up to about 4.29 billion values wide, and up to 1,000 numbers at a time.
  • Uses crypto.getRandomValues with rejection sampling.
  • Results are not recorded, so keep your own record for any official draw.

Frequently asked questions

How do I pick a random number between 1 and 10?

Set the minimum to 1, the maximum to 10 and press Generate.

Is it truly random?

It uses your browser's secure random generator, which is suitable for security uses and much stronger than Math.random.

How do I get numbers with no repeats?

Tick No repeats. The count cannot be larger than the number of values in the range.

Can I use this for a raffle?

Yes, for informal draws. Give each entry a number and draw unique numbers. For official contests, follow the rules and record keeping required for your draw.

Can it generate decimals?

Not at present. It generates whole numbers only.

References

Page last reviewed on . This calculator gives estimates for planning only; it is not financial advice and not an offer from any lender.