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
- Range: set a minimum and a maximum and generate one random whole number between them, both ends included.
- 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.
- 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.
- 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?
Can the same number appear twice?
Are the minimum and maximum included?
Can I generate decimals?
Why do I get streaks of the same result?
Is it fair for a giveaway or a draw?
Related General Calculators
Percentage Calculator
Calculate percentages instantly. Find what percent of a number, percentage change, and percentage difference. Free and fast.
Fraction Calculator
Add, subtract, multiply, and divide fractions. Simplify fractions and convert to mixed numbers. Free online fraction calculator.
Ratio Calculator
Simplify ratios and find missing values in proportions. Free online ratio calculator with step-by-step results.
Exponent Calculator
Calculate powers and exponents instantly. Compute base raised to any power including negative and fractional exponents. Free online tool.
Log Calculator
Calculate logarithms with any base. Find natural log (ln), log base 10, and custom base logarithms. Free online log calculator.
Factor Calculator
Find all factors, prime factorisation, factor pairs, GCD, and LCM. Free online factor calculator with instant results.