What is a Random Number Generator?
A random number generator picks numbers from a range so that every allowed value is equally likely. To pick a random number from 1 to 100, set the minimum to 1, the maximum to 100 and the count to 1: each of the 100 integers has a 1 in 100 (1%) chance. This one draws up to 10,000 integers or decimals in any range, with or without repeats, and can sort the result. The numbers are pseudo-random: they come from a seeded algorithm, so the same seed and settings reproduce exactly the same list.
What the Random Number Generator does
Use it as a random number picker when you just need it to give you a random number, or to get random numbers in bulk: it can generate a series of random numbers, a simple random sample from a numbered list, or a random order for a whole list. Set a minimum, a maximum and how many numbers you want. For integers, each whole number in the range has the same chance on every draw; choose no repeats to draw without replacement, as in a lottery or when selecting a sample. For decimals, each value with the chosen number of decimal places is equally likely. The result comes with its count, sum, mean, smallest and largest value, and the seed that produced it.
The generator suits sampling, classroom demonstrations, games, informal raffles and simulations. It is fast, unbiased across the range and repeatable, which is exactly what a statistics exercise needs and exactly what security does not. Do not use it for passwords, security tokens, cryptographic keys, gambling with real money, or any lottery or prize draw that is regulated or audited: those need a cryptographically secure or certified generator.
How to use the Random Number Generator
- Enter the Minimum and Maximum of the range. Both ends can be drawn.
- Enter How many numbers you want (1 to 10,000) and choose Integers or Decimals. For decimals, pick the number of Decimal places.
- For integers, set Repeats to allowed (with replacement, like rolling a die) or no repeats (without replacement, like drawing lottery balls).
- Tick Sort from smallest to largest if the order of the draws does not matter.
- Press Generate new numbers for a fresh set. To reproduce a result later, note the Seed shown with it and type it back in with the same settings.
Formulas behind the random numbers
Every draw follows a discrete uniform distribution over the allowed values.
| Symbol | Meaning |
|---|---|
| min, max | smallest and largest value that can be drawn |
| N | number of different values in the range |
| n | how many numbers are drawn |
| X | the result of a single draw |
| seed | whole number from 0 to 4,294,967,295 that fixes the sequence |
Random bits come from the xoshiro128** algorithm, whose state is filled from the seed with SplitMix32. Each number is produced by rejection sampling: the generator takes just enough bits to cover N values and redraws any result that falls outside the range, so no value is favoured (there is no modulo bias).
Draws without repeats use a partial Fisher–Yates shuffle, which gives every possible selection, in every order, the same probability.
Decimals are drawn from the evenly spaced values with the chosen number of decimal places between min and max, both ends included. With 2 decimal places from 0 to 1 there are 101 possible values, 0.00 to 1.00. The variance formula above is for integers; for decimals multiply it by the square of the spacing.
Worked example
Worked example: a random sample of 5 students from a class of 30
Problem. A teacher wants to choose 5 of the 30 students on a numbered class list so that every student has the same chance. Set Minimum 1, Maximum 30, How many numbers 5, Integers, No repeats, sorted, with seed 2026.
- 01The possible values are the integers 1 to 30, so N = 30 − 1 + 1 = 30.
- 02No student may be chosen twice, so the draw is without replacement: the first number comes from 30 values, the second from the remaining 29, and so on down to 26.
- 03With seed 2026 the generator draws 12, 22, 17, 4 and 11 in that order, which sorts to 4, 11, 12, 17, 22.
- 04Each student had a 5 in 30 chance of selection, 5 / 30 = 0.1667.
- 05The number of different groups of 5 is C(30, 5) = 142,506, and each was equally likely.
Answer. The sample is the students numbered 4, 11, 12, 17 and 22. Anyone who enters seed 2026 with the same settings gets the same five numbers, so the selection can be checked afterwards.
With replacement vs without replacement
With replacement means a number goes back into the pool after it is drawn, so it can come up again. Without replacement means each number can be drawn only once. Drawing all N numbers without repeats gives a random ordering of the whole range, which is how to shuffle a numbered list.
| Repeats allowed (with replacement) | No repeats (without replacement) | |
|---|---|---|
| Physical model | Rolling dice, flipping coins, spinning a wheel | Lottery balls, dealing cards, names from a hat |
| Chance of each available value | Always 1 / N | 1 / N, then 1 / (N − 1), then 1 / (N − 2), … |
| Draws are independent | Yes | No: each draw changes what is left |
| Most numbers you can draw | Any amount | N, the size of the range |
| Typical use | Simulations, bootstrap resampling, games | Simple random samples, random order, raffles |
How to draw a simple random sample from a numbered list
A simple random sample gives every member of the population, and every possible group of the chosen size, the same chance of selection. With a list of the population you can draw one in a minute:
- Number the list from 1 to N. Each person or item gets exactly one number, and nobody is left off.
- Set Minimum to 1 and Maximum to N.
- Set How many numbers to the sample size n. The Sample Size Calculator can tell you how large n needs to be.
- Choose Integers and No repeats, so nobody is selected twice.
- Generate the numbers and select the list entries with those numbers. Record the seed so the selection can be checked or repeated.
Seeds, reproducibility and how random the numbers are
Arithmetic alone cannot produce true randomness. A pseudo-random number generator starts from a number called the seed and applies a fixed formula over and over, producing a sequence that passes statistical tests for randomness but is completely determined by the seed. Seed 2026 with the same range and options gives the same numbers on every device, today or next year.
That repeatability is useful: a classmate can check your sample, a simulation can be rerun exactly, and a selection reported in a study can be audited. Generate new numbers swaps in a new seed, itself chosen by your browser’s random function, and draws a fresh list.
The same property makes these numbers unsuitable for secrets. There are only about 4.3 billion seeds, and anyone who knows or guesses the seed can reproduce the whole sequence. Passwords, tokens and keys need a cryptographically secure generator, and regulated draws need certified equipment and procedures.
Pseudo-random vs true random number generators
There are two kinds. A true random number generator measures an unpredictable physical process, such as electronic noise, radioactive decay or atmospheric noise, and turns it into numbers. A pseudo-random number generator (PRNG) is an algorithm: it starts from a seed and repeats a fixed calculation, so its output looks random and passes statistical tests but is fully determined by the seed. Computers, spreadsheets and statistics software use PRNGs because they are fast and repeatable.
Turning random bits into a number in your range is a separate step, and it is where simple generators go wrong. Taking the remainder after division (bits mod N) slightly favours the low values whenever N does not divide the number of possible bit patterns. This tool uses rejection sampling instead: it takes just enough bits to cover N values and redraws any result outside the range, so every value is exactly equally likely.
| Pseudo-random (this tool) | True random (hardware) | Cryptographically secure | |
|---|---|---|---|
| Source | Algorithm started from a seed | Physical noise | Algorithm reseeded from physical noise |
| Reproducible from a seed | Yes | No | No |
| Predictable by an attacker | Yes, if the seed is known | No | No |
| Good for | Sampling, simulation, teaching, games | Lotteries, scientific sources of entropy | Passwords, keys, security tokens |
Random assignment to treatment and control groups
In an experiment, random assignment decides which participants receive each treatment, so the groups differ only by chance before the treatment starts. To split 20 numbered participants into two groups of 10, draw all 20 numbers without repeats (the Shuffle 1–20 preset) and give the first 10 to the treatment group and the rest to control.
With seed 2026 the shuffle is 12, 16, 3, 10, 4, 1, 13, 11, 8, 15, 7, 20, 14, 17, 19, 5, 2, 6, 9, 18. Participants 1, 3, 4, 8, 10, 11, 12, 13, 15 and 16 go to treatment; 2, 5, 6, 7, 9, 14, 17, 18, 19 and 20 go to control. For three or more groups, cut the shuffled list into consecutive blocks of the group sizes. Record the seed in your methods so the allocation can be checked.
Common use cases
- Random sampling: pick n people, households or records from a numbered list without repeats.
- Random assignment: draw all the participant numbers without repeats to shuffle them, then split the shuffled list into treatment and control groups.
- Classroom probability: simulate dice rolls or coin flips (0 = tails, 1 = heads) and compare the observed frequencies with the theoretical values from the Probability Calculator.
- Games and decisions: roll dice, pick a number from 1 to 10 or 1 to 100, decide who goes first, or draw raffle winners among friends.
- Simulation input: generate uniform integers or decimals to test a spreadsheet model or to illustrate the uniform distribution.
- Lottery-style picks: draw 6 different numbers from 1 to 49. Every combination has the same chance, 1 in 13,983,816 (see the Combination Calculator), so random picks are no better and no worse than any others.
Assumptions and limitations
- Not for security. The numbers are pseudo-random and reproducible from a 32-bit seed. Never use them for passwords, PINs, security tokens, encryption keys or anything an attacker would gain from predicting.
- Not for regulated draws. Official lotteries, licensed gambling and legally binding prize draws require certified generators and audited procedures.
- One run gives at most 10,000 numbers. Integer limits can be anywhere from −1,000,000,000,000,000 to 1,000,000,000,000,000; with decimals the allowed limits shrink tenfold for each decimal place.
- Decimals are uniform over values with 1 to 8 decimal places and always allow repeats. Random values from other distributions, such as the normal distribution, need statistical software.
- Negative limits and very large numbers work: a range such as −50 to 50, or 1 to 1,000,000,000,000, is drawn exactly. Use the uniform distribution calculator for probabilities of a continuous range rather than draws from it.
- Random does not mean evenly spread. Short runs often contain repeats, streaks and clusters, and the mean of the numbers will usually differ from the midpoint of the range. That variation is expected, not a fault.
- A random sample is only as good as the list it is drawn from. If the numbered list leaves out part of the population, the sample cannot represent it.
Frequently asked questions
Are these numbers truly random?
What is a seed in a random number generator?
How do I generate random numbers without repeats?
How does a random number generator work?
How do I pick a random number between 1 and 100?
Can I use this to pick lottery numbers?
How do I simulate rolling dice or flipping a coin?
What are the limitations of random number generators?
How do I generate a random decimal between 0 and 1?
Cite this page
Statculator. (2026, November 14). Random Number Generator. Retrieved November 14, 2026, from https://statculator.com/probability/random-number-generator/