Home › Math › Random Number Generator

Random Number Generator

Pick one or many random numbers from any range. Choose whole numbers or decimals, with or without repeats.

Your random number

-

Numbers come from your browser's secure random generator. Each result is independent, and every value in the range has the same chance. Do not use this for passwords or for official lotteries.

What is a random number generator?

A random number generator picks numbers with no pattern, so you cannot predict the next one. Every number in your range has the same chance of being chosen. People use it to pick a raffle winner, choose who goes first in a game, draw a sample for a survey, assign tasks, or settle a friendly argument.

Humans are surprisingly poor at being random. When people try to pick a "random" number, they tend to avoid repeats, favour numbers like 7 or 17, and avoid the ends of the range. A good generator has none of these habits. It treats every value in the range the same way, which is what makes it fair for draws, games and tests.

How to use it

  • Choose whole numbers or decimals.
  • Type the smallest and largest value. Both ends can be picked.
  • Enter how many numbers you need, up to 1,000.
  • Tick "No repeats" if every number must be different, for example in a raffle draw.
  • Tick "Sort" to see the list in order, then press Generate again for a new set.

How the numbers are picked

Whole number = minimum + a random choice from (maximum − minimum + 1) equal chances
Decimal = minimum + a random fraction × (maximum − minimum)

The calculator uses your browser's secure random source (called crypto.getRandomValues) instead of the simpler Math.random. For whole numbers it also avoids "modulo bias", a small error that makes some numbers slightly more likely when random values are squeezed into a range. That keeps every number equally likely.

True random and pseudo-random numbers

There are two broad kinds of random numbers. True random numbers come from a physical process that cannot be predicted, such as electrical noise or radioactive decay. Pseudo-random numbers come from a mathematical formula that starts from a hidden starting value, called a seed. They look random, but in principle the same seed gives the same sequence.

Simple pseudo-random functions are fine for casual games, but they are not designed to resist prediction. A cryptographic source, like the one your browser provides, is built so that the output is very hard to guess even if someone has seen earlier numbers. That is why this tool uses it for everyday picks such as draws and samples.

Examples

  • Roll a die: from 1 to 6, one number.
  • Lottery-style draw: from 1 to 49, 6 numbers, no repeats.
  • Pick a winner: from 1 to the number of entries, one number.
  • Random percentage: decimals from 0 to 100 with 2 decimal places.
  • Tabletop game dice: from 1 to 20 for a twenty-sided die, or from 1 to 100 for a percentile roll.
  • Survey sample: if you have 1,000 customers numbered 1 to 1,000 and want 50 of them, choose 50 numbers with "No repeats" ticked.

Everyday uses

  • Giveaways and raffles: number each entry and draw the winners fairly, with no repeats so nobody wins twice.
  • Classrooms: pick which student answers next or split a class into random groups.
  • Games and sports: decide who starts, set the order of play or simulate dice and cards.
  • Research and quality checks: pick random items to inspect or random people to interview, so the sample is not biased by personal choice.
  • Testing and coding: create sample data to test forms, spreadsheets and programs.
  • Decisions: choose a restaurant, a movie or a chore when nobody wants to decide.

A little probability

Knowing the odds helps you read your results. On a fair six-sided die, each face has a chance of 1 in 6, or about 16.7 percent. A coin flip, which you can model with the range 1 to 2, gives each side a 50 percent chance. For a pair of dice, the total 7 is the most common, with 6 chances out of 36, or 1 in 6, while the totals 2 and 12 each have only 1 chance out of 36.

For a lottery-style draw of 6 numbers from 49, there are 13,983,816 possible combinations, so any one ticket has a chance of about 1 in 14 million. When you draw 3 numbers from 1 to 10 with no repeats, there are 10 × 9 × 8 = 720 ordered results, because each pick leaves one fewer number available.

Over a very large number of rolls, the average of a die settles close to 3.5, the middle of 1 to 6. This is called the law of large numbers. In a short run, though, the results can look far from even.

Good to know

  • Random does not mean evenly spread. Short runs often show streaks and repeats, and that is normal.
  • With repeats allowed, the same number can come up more than once, even twice in a row.
  • With "No repeats", you cannot ask for more numbers than the range holds. From 1 to 10 you can get at most 10.
  • The tool does not save or send your numbers anywhere. Everything happens in your browser.
  • Do not use it to create passwords, security keys or numbers for an official lottery.

Tips for running a fair draw

  • Number every entry before you start, and share the list so everyone can check that their number is included.
  • Decide the range and the rules before you press Generate, not after you see the result.
  • For several winners, tick "No repeats" so the same entry cannot win twice.
  • If you need a back-up winner in case the first one cannot be reached, generate one extra number at the same time.
  • Take a screenshot of the result if you need a record of the draw.

Choosing between whole numbers and decimals is simple. Use whole numbers for counting things, such as entries, dice, cards or seats. Use decimals when you need measurements or values between whole numbers, such as a random price, a weight or a score.

Common myths about randomness

One well-known mistake is the gambler's fallacy, the belief that a number is "due" because it has not appeared for a while. Each draw is independent. If a fair coin lands on heads five times, the chance of heads on the next flip is still 50 percent. The generator has no memory of earlier results, so a long gap does not make a number more likely next time.

Another myth is that a result with a pattern, such as 1, 2, 3, 4, 5, 6, cannot be random. In a draw of 6 numbers from 49, that set is exactly as likely as any other set. It only seems special to us because we notice patterns.

Frequently asked questions

Can I get the same number twice?

Yes, unless you tick "No repeats". Each pick is independent when repeats are allowed, so the same value can appear again.

Is the generator fair?

Every number in your range has an equal chance on each pick. The tool uses a secure browser source and corrects for modulo bias, so there is no built-in favourite number.

How many numbers can I generate at once?

You can generate up to 1,000 numbers in one go. Press Generate again whenever you want a fresh set.

Related tools: Average Calculator, Percentage Calculator and Scientific Calculator.

Need another calculator?

Browse all calculators
Scroll to Top