🎲

Random Number Generator

Generate secure random numbers in any range, with optional uniqueness.

About this tool

Last updated:

Generate random whole numbers

This random number generator picks whole numbers between a minimum and a maximum that you set. You can ask for one number or many, stop repeats and sort the list. It works for draws, games, sampling and quick decisions.

How to use it

  1. Enter Min and Max. They are included in the range. The defaults are 1 and 100.
  2. Enter Count, how many numbers you want. The most you can get in one go is 1,000.
  3. Tick No repeats if every number must be different, and Sort results to list them from low to high.
  4. Click Generate. Use Copy all to copy the results as a comma-separated list.

How it works

The tool uses your browser's secure random source (crypto.getRandomValues), not Math.random. It also discards draws that would favour some numbers over others, so each number in the range has the same chance. With No repeats on, a number that was already drawn is skipped and drawn again.

What you see

  • One number is shown large. Several numbers are shown as a list of chips.
  • A count above the results, such as "5 numbers".
  • An error box if the input is not valid.

Assumptions and limits

  • Integers only. There are no decimals.
  • Min must be less than or equal to Max.
  • With No repeats, Count cannot be larger than the number of values in the range.
  • Count above 1,000 is reduced to 1,000.
  • Numbers outside the safe integer range of JavaScript are rejected.

Frequently asked questions

Are the numbers truly random?

They come from the browser's cryptographic random generator, which is much stronger than a basic pseudo-random call. It is fine for draws and games. For a legal lottery, follow that lottery's own rules.

Are Min and Max included?

Yes. Both ends can come up.

How do I draw lottery-style numbers?

Set the range, for example 1 to 49, set Count to 6, turn on No repeats and Sort results.

Why do I get an error about unique numbers?

You asked for more different numbers than the range contains. Widen the range or lower the count.

More to explore

Related Text Tools

Browse all tools from the same category.

Showing 1-2 of 27