A random number generator produces a random integer within a specified range (minimum to maximum, inclusive).
What is a random number generator?
A random number generator picks integers between a minimum and maximum you set, inclusive. You choose how many numbers to draw on each roll, up to 20 at once. Results come from the browser pseudo-random engine, fine for games, spot checks, and classroom picks. It is not meant for cryptography or lottery security.
How to use the Random Number Generator
- Set Minimum to the smallest integer allowed.
- Set Maximum to the largest integer allowed.
- Set Count to how many numbers each roll produces.
- Click Roll Random Numbers to generate a new set.
- Re-roll when you need a fresh unbiased pick.
About this calculator
A random number generator produces a random integer within a specified range (minimum to maximum, inclusive). Random numbers are used in games, simulations, statistical sampling, cryptography, lottery draws, and anywhere you need unbiased selection.
Computers generate pseudo-random numbers using algorithms that produce sequences that appear random but are deterministically generated from a starting seed value.
How the math works
- : Lower bound of the range (inclusive)
- : Upper bound of the range (inclusive)
- : Probability of any single value being selected
Random number example: pick from 1 to 100
You want one fair integer from 1 through 100 for a class raffle. Set Minimum = 1, Maximum = 100, and Count = 1. Each roll uses floor(random × (100 − 1 + 1)) + 1, so every integer in the range has the same chance.
The exact digit changes every click, which is expected. If you need five unique student IDs without repeats, this tool may repeat values because it draws with replacement. For unique picks, roll one at a time and skip duplicates, or use a dedicated lottery list. The inclusive range size is max − min + 1 = 100 options here, which is the sample space size for probability homework.
For a fair single pick, set Count to 1 so the list is easy to read aloud in class without sorting duplicates. Minimum 1 and maximum 6 with Count 2 simulates two dice sums for probability demos, though sums are not uniform. For unique winners, draw one number at a time and discard repeats manually. Set Maximum below Minimum only after swapping them so the range stays valid. The inclusive range size formula matches how many integers sit between your min and max settings.
Common uses
- Pick a random number for a game or contest
- Select a random sample from a dataset
- Randomly assign items in a classroom or event
- Simulate dice rolls or coin flips
Frequently asked questions
Are computer-generated random numbers truly random?
No. Computer-generated numbers are usually pseudo-random, which means they come from deterministic algorithms that appear statistically random. For most applications, such as games and sampling, that is enough. For cryptography and security, hardware random number generators are used when true randomness is needed.
How many integers are in the range from 1 to 50 inclusive?
50 integers. Count = max − min + 1 = 50 − 1 + 1. When Minimum = 1 and Maximum = 50, each roll has a 1/50 chance for any single value if the generator is uniform.
Why did I get the same random number twice in a row?
Each roll is independent, like dice. Repeats are normal, especially with a small range or large Count. For a single pick from 1 to 100, back-to-back duplicates happen about 1% of the time.
What is the highest Count I can generate in one roll?
Twenty numbers per click. The tool caps Count at 20 so the list stays readable on mobile. Run multiple rolls if you need more samples for a statistics exercise.
Related calculators
- Math Calculator
- Percentage Calculator
- Fraction Calculator
- Exponent Calculator
- Logarithm Calculator
- Nth Root Calculator
- Ratio Calculator
- Pythagorean Theorem
Maintained by J Jaya Prakash · Last updated: October 2026