Back to Home

Random Number Generator

Generate random numbers for games, passwords, or testing

Generator Settings

Quick Presets

💡 Use Cases

  • • Gaming: Dice rolls, lottery numbers, random events
  • • Contests: Prize drawings, random selections
  • • Testing: Generate test data for development
  • • Decisions: Random choices when you can't decide
  • • Sampling: Random sampling for surveys or experiments

Numbers come from your browser's cryptographically secure generator (crypto.getRandomValues) using rejection sampling, so every whole number from the minimum to the maximum (inclusive) is equally likely.

Overview

The Random Number Generator picks one or more whole numbers between a minimum and maximum you choose, with both ends included. You can generate up to 10,000 numbers at once, allow or forbid duplicates, and use negative numbers. It is handy for dice rolls, raffles and prize drawings, picking a random item from a numbered list, classroom activities and generating test data.

Numbers come from your browser's cryptographically secure generator, crypto.getRandomValues. To turn raw random bits into a number in your range without favoring any value, the page uses rejection sampling: draws that would cause modulo bias are discarded and redrawn, so every number from the minimum to the maximum is exactly equally likely. When duplicates are not allowed, it uses a partial Fisher–Yates shuffle, the standard way to draw without replacement.

After each run the page shows the sum, average, minimum, maximum and median of the results, and a chart of the most frequent numbers across your last 100 results.

How to Use

  1. Enter a Minimum Value and a Maximum Value as whole numbers; negative values are allowed, and both ends are included.
  2. Enter How Many Numbers you want, from 1 to 10,000.
  3. Untick Allow duplicate numbers if every result must be different, for example when drawing raffle winners. The count cannot exceed the number of values in the range.
  4. Click Generate Numbers, or start from a Quick Preset such as Dice (1-6), Card Deck (1-52) or Lottery 6/49.
  5. Click Copy to copy the results as a comma-separated list, review the Statistics panel and frequency chart, and click Clear All to reset the results and history.

Frequently Asked Questions

Is this random number generator truly random?

It uses a cryptographically secure pseudorandom number generator provided by your browser and operating system, seeded from hardware and system entropy. Its output is unpredictable for all practical purposes and is suitable for drawings, games and sampling. It is not a hardware "true" random source such as radioactive decay or atmospheric noise, but for everyday uses the difference does not matter.

How do I pick a random winner for a giveaway?

Number your entries from 1 to the total, for example 1 to 250. Set the minimum to 1, the maximum to 250 and How Many Numbers to the number of winners, then untick Allow duplicate numbers so nobody can win twice. Click Generate Numbers and match each result to the entry with that number. Taking a screenshot of the result helps show the draw was fair.

Are the minimum and maximum values included?

Yes. Both limits are inclusive, so a range of 1 to 6 can return 1, 2, 3, 4, 5 or 6, each with a probability of exactly 1 in 6. You can even set the minimum and maximum to the same value, in which case that number is always returned. If the minimum is larger than the maximum, the page shows an error instead of guessing what you meant.

How are the average and median calculated?

The average is the sum of the generated numbers divided by how many there are. The median is the middle value after sorting; with an even count it is the average of the two middle values. For example, if the results are 3, 8, 15, 22 and 40, the sum is 88, the average is 17.6 and the median is 15. For 2, 4, 7 and 9 the median is 5.5.

Why do some numbers appear more often in the frequency chart?

Random does not mean evenly spread in a small sample. With 100 results from 1 to 100, it is normal for some numbers to appear two or three times and many not at all. The chart tracks only your last 100 generated numbers. Over very large samples each value tends toward the same frequency, but no number is ever "due" to come up.

Can I use this to generate lottery numbers or passwords?

For lottery picks, yes: the Lottery 6/49 preset draws six different numbers from 1 to 49, though random picks do not improve your odds of winning. For passwords, use a dedicated password generator instead, because it draws from letters, numbers and symbols and produces far more possible combinations than a short list of numbers.