Skip to content

Random Number Generator — Step-by-Step Solutions

The Random Number Generator creates random numbers within any range you specify. It supports five modes: generate a number in a range, produce multiple random numbers at once, simulate dice rolls, flip coins, and pick randomly from a custom list.

Perfect for games, statistics, decision-making, and any situation where you need an unbiased random selection. Results are generated using a cryptographically suitable algorithm.

Your calculations will appear here

How to Use the Random Number Generator

  1. Range: set a minimum and a maximum and generate one random whole number between them, both ends included.
  2. Multiple: choose the minimum, maximum and how many numbers (1 to 1000) you want. Note that numbers are drawn independently, so the same value can appear more than once.
  3. Dice Roll: enter the number of sides (2 to 1000) and how many dice (1 to 100) to roll. The total is shown with the individual rolls. Coin Flip: choose 1 to 100 flips and see heads and tails counts.
  4. Custom List: type items separated by commas, such as names for a draw or choices for a decision, and one is picked at random.

Formula and Theory

A random number generator produces a value where every allowed outcome is equally likely and each draw is independent of the previous ones. For a range from min to max inclusive, each of the max - min + 1 whole numbers has the same probability.

Computers do not generate truly random numbers on their own. This tool uses the browser pseudo-random number generator, which is statistically uniform and suitable for games, classroom activities, sampling and tie-breaking. It is not designed for cryptography, passwords or anything where an attacker must not be able to predict the output.

Independence has two consequences. Repeated values are normal in a list of random numbers, and streaks of heads or of the same dice value happen far more often than people expect. A fair coin has no memory, so the next flip is 50-50 whatever came before.

Probabilities for dice and coins can be worked out by counting. Two six-sided dice give 36 equally likely pairs, and each total from 2 to 12 has a probability equal to the number of pairs giving that total divided by 36.

Worked Examples

Example 1: Picking a raffle winner

Problem: There are 250 entries numbered 1 to 250. How do you draw one winner, and how likely is each entry?

Solution: Use Range with minimum 1 and maximum 250 and generate one number. There are 250 - 1 + 1 = 250 equally likely outcomes, so each entry has probability 1/250 = 0.4%.

Answer: Range 1 to 250; each entry has a 0.4% chance

Example 2: Rolling two dice

Problem: Roll two six-sided dice. How likely is a total of 7, and what are the lowest and highest totals?

Solution: There are 6 x 6 = 36 equally likely pairs. A total of 7 can be made 6 ways: (1,6), (2,5), (3,4), (4,3), (5,2), (6,1). So P(7) = 6/36 = 1/6, about 16.7%. The lowest total is 1 + 1 = 2 (probability 1/36) and the highest is 6 + 6 = 12 (probability 1/36).

Answer: P(7) = 1/6 (16.7%); totals range from 2 to 12

Example 3: Flipping a coin 10 times

Problem: Flip a fair coin 10 times. What is the chance of exactly 5 heads?

Solution: There are 2^10 = 1,024 equally likely sequences. The number with exactly 5 heads is 10C5 = 10! / (5! x 5!) = 252. So P = 252 / 1,024 = 0.246.

Answer: About 24.6%, so exactly 5 heads is far from guaranteed

Example 4: Choosing from a list

Problem: Pick a restaurant from: Pizza, Sushi, Tacos, Curry.

Solution: Enter the four items in Custom List separated by commas. Each is equally likely, so each has probability 1/4 = 25% on every draw.

Answer: Each option has a 25% chance

Frequently Asked Questions

Is this random number generator truly random?
It is pseudo-random: generated by an algorithm built into your browser. That is statistically fair for games, draws and sampling, but not suitable for security uses such as passwords or encryption keys.
Can the same number appear twice?
Yes. Each number is drawn independently, so repeats are possible when you generate several. If you need unique values, such as lottery numbers, discard repeats and draw again.
Are the minimum and maximum included?
Yes. Both ends of the range can be returned. The range 1 to 6 can produce 1, 2, 3, 4, 5 or 6.
Can I generate decimals?
This tool produces whole numbers. To get a decimal, generate a whole number and divide, for example a number from 0 to 1000 divided by 1000 gives three decimal places.
Why do I get streaks of the same result?
Streaks are a normal feature of randomness. In 10 fair coin flips, a run of 4 or more of the same side is common. If results never repeated, that would be less random, not more.
Is it fair for a giveaway or a draw?
Each entry has an equal chance, which is what a fair draw needs. For prize draws, check the rules that apply to your country, and keep a record of how the winner was picked.

Related General Calculators

Related Articles