Skip to content
Math

Random Number Generator

Generate one or many random whole numbers between a minimum and a maximum, with or without repeats, using your browser's secure random source.

Free · no sign-up Runs in your browser

How to use the random number generator

Enter the smallest and largest number you want, choose how many numbers to draw and press Generate. Both limits are included, so a range of 1 to 6 can return any face of a die.

  • How many can be anything from 1 to 1,000.
  • Allow duplicates lets the same number appear more than once, like rolling a die several times. Leave it unchecked to draw unique numbers, like pulling raffle tickets from a hat.
  • Sort results lists the numbers from smallest to largest instead of in the order they were drawn.

Use the Copy button to put the list on your clipboard, separated by commas.

How the numbers are chosen

The numbers come from the cryptographically secure random generator built into your browser, the same kind of source used for encryption keys. Nothing is sent to a server.

A common mistake when turning a random value into a range is to take the remainder after division. If the random source can produce 10 different values and you want a number from 1 to 3, the remainder method gives one result four chances and the others only three. To avoid this bias, the generator throws away the few raw values that would make the split uneven and draws again. Every number in your range therefore has exactly the same chance.

Example

To pick 6 lottery numbers from 1 to 49, set the minimum to 1, the maximum to 49 and how many to 6, leave duplicates off and tick Sort results. The result might look like 4, 11, 23, 30, 38, 47.

Good to know

  • Without duplicates you cannot ask for more numbers than the range contains. From 1 to 10 you can draw at most 10 unique numbers.
  • Negative numbers are allowed, for example a range from -50 to 50.
  • Each press of Generate is independent of the previous one. Earlier results do not make any number more or less likely next time.
  • For official draws, games of chance with real money or security purposes, follow the rules and tools required by the organizer.

Frequently asked questions

Are the minimum and maximum included?

Yes. Both limits can be drawn. A range from 1 to 10 contains ten possible numbers.

How do I get random numbers without repeats?

Leave the Allow duplicates box unchecked. Each number in the result will then be different, as long as the range is at least as large as the number of values you ask for.

Is this generator truly random?

It uses the browser's cryptographically secure random source, which is designed to be unpredictable, and it removes modulo bias so every number in the range is equally likely. That is more than enough for games, classroom picks, raffles and sampling.

Can I generate decimal numbers?

This tool produces whole numbers only. For a decimal, generate a whole number in a wider range and divide it, for example draw from 0 to 1000 and divide by 100 for two decimal places.