Skip to content
Statculator
Probability & Counting

Random Number Generator

Random number generator: pick a number from 1 to 100 or any range, integers or decimals, with or without repeats, sorted, with a seed to reproduce the draw.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try
Number type

Allow repeats for dice and coin flips. Choose no repeats for lottery draws, raffles and random samples.

The same seed and settings always give the same numbers. Generate new numbers picks a new seed.

Pseudo-random numbers for sampling, teaching, games and simulations. Not for passwords, security tokens or regulated draws.

Results

10 random integers from 1 to 100
45, 82, 58, 3, 26, 44, 54, 49, 27, 17
Repeats allowed, in draw order, seed 2026
Count
10
Sum
405
Mean
40.5
Minimum drawn
3
Maximum drawn
82
Seed
2026
Possible values in the range, N
100
Midpoint of the range
50.5
Different values drawn
10

Interpretation: Each of the 100 integers from 1 to 100 had the same chance, 1 in 100 (1%), on every draw. Repeats are allowed, but none happened this time.

Step-by-step solution

  1. 1

    Set the range of possible values

    Both ends of the range can be drawn.

    integers from 1 to 100
    N = 100 − 1 + 1 = 100
  2. 2

    Start the generator from the seed

    The seed is expanded into the starting state of the xoshiro128** generator. From that point every random bit is fixed, which is what makes the result reproducible.

    seed = 2026
  3. 3

    Draw each number independently

    Each draw takes 7 random bits, which give a whole number from 0 to 127. Results of 100 or more are thrown away and drawn again; the rest are added to the minimum. Rejecting instead of wrapping around keeps every value exactly equally likely.

    P(each value) = 1 / N = 1 / 100 = 0.01
  4. 4

    Keep the numbers in the order drawn

    45, 82, 58, 3, 26, 44, 54, 49, 27, 17
  5. 5

    Summarize the result

    For a uniform draw the long-run average is the midpoint of the range. A single set of numbers will land near it, not on it.

    sum = 405
    mean = 405 / 10 = 40.5
    midpoint of the range = (1 + 100) / 2 = 50.5
  6. 6

    Reproduce or refresh

    Entering seed 2026 with the same range and options returns exactly these numbers on any device. Generate new numbers replaces the seed with a new one and draws a fresh set.

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

  1. Enter the Minimum and Maximum of the range. Both ends can be drawn.
  2. Enter How many numbers you want (1 to 10,000) and choose Integers or Decimals. For decimals, pick the number of Decimal places.
  3. For integers, set Repeats to allowed (with replacement, like rolling a die) or no repeats (without replacement, like drawing lottery balls).
  4. Tick Sort from smallest to largest if the order of the draws does not matter.
  5. 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.

Number of possible integers
N = max − min + 1
Probability of each value on one draw
P(X = k) = 1 / N
Mean and variance of one draw
E[X] = (min + max) / 2 Var(X) = (N² − 1) / 12
Different sets of n numbers without repeats
C(N, n) = N! / (n! · (N − n)!)
Chance that a given value appears among n draws
with repeats: 1 − (1 − 1/N)ⁿ without repeats: n / N
Formula symbols
SymbolMeaning
min, maxsmallest and largest value that can be drawn
Nnumber of different values in the range
nhow many numbers are drawn
Xthe result of a single draw
seedwhole 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.

  1. 01The possible values are the integers 1 to 30, so N = 30 − 1 + 1 = 30.
  2. 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.
  3. 03With seed 2026 the generator draws 12, 22, 17, 4 and 11 in that order, which sorts to 4, 11, 12, 17, 22.
  4. 04Each student had a 5 in 30 chance of selection, 5 / 30 = 0.1667.
  5. 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 modelRolling dice, flipping coins, spinning a wheelLottery balls, dealing cards, names from a hat
Chance of each available valueAlways 1 / N1 / N, then 1 / (N − 1), then 1 / (N − 2), …
Draws are independentYesNo: each draw changes what is left
Most numbers you can drawAny amountN, the size of the range
Typical useSimulations, bootstrap resampling, gamesSimple 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:

  1. Number the list from 1 to N. Each person or item gets exactly one number, and nobody is left off.
  2. Set Minimum to 1 and Maximum to N.
  3. Set How many numbers to the sample size n. The Sample Size Calculator can tell you how large n needs to be.
  4. Choose Integers and No repeats, so nobody is selected twice.
  5. 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
SourceAlgorithm started from a seedPhysical noiseAlgorithm reseeded from physical noise
Reproducible from a seedYesNoNo
Predictable by an attackerYes, if the seed is knownNoNo
Good forSampling, simulation, teaching, gamesLotteries, scientific sources of entropyPasswords, 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?

No. They are pseudo-random: a deterministic algorithm (xoshiro128**) produces them from a seed. The output is statistically uniform and unpredictable enough for sampling, teaching, games and simulations, but anyone with the seed can reproduce it, so it must not be used for cryptography, security tokens or regulated lotteries.

What is a seed in a random number generator?

The seed is the starting value of the algorithm. The same seed with the same settings always produces the same numbers, which lets you reproduce or verify a result, and a different seed gives a different, unrelated-looking sequence. This tool accepts whole-number seeds from 0 to 4,294,967,295 and picks a new one each time you press Generate new numbers.

How do I generate random numbers without repeats?

Choose Integers and set Repeats to no repeats (without replacement). Each number can then appear at most once, as when drawing lottery balls. The amount you ask for cannot exceed the number of integers in the range: at most 49 different numbers can be drawn from 1 to 49.

How does a random number generator work?

A pseudo-random generator, like this one, starts from a seed and applies a fixed formula again and again to produce bits that look random; the same seed always gives the same sequence. Those bits are then mapped onto your range without bias (here by rejection sampling). A true random generator instead measures a physical source of noise and cannot be reproduced.

How do I pick a random number between 1 and 100?

Set the minimum to 1, the maximum to 100 and how many numbers to 1, or press the “Pick 1–100” preset. Each of the 100 integers has a 1 in 100 (1%) chance, and both 1 and 100 are included. For 1 to 10, use the “Pick 1–10” preset; each number then has a 10% chance. Press Generate new numbers for another pick.

Can I use this to pick lottery numbers?

You can use it to choose which numbers to play: the “Lottery 6 from 1–49” preset draws six different numbers and sorts them. It does not improve your odds, because every combination is equally likely to win (1 in 13,983,816 for 6 from 49). It must not be used to run an official lottery or prize draw, which requires certified equipment.

How do I simulate rolling dice or flipping a coin?

For one die, draw 1 integer from 1 to 6. For two dice, draw 2 integers from 1 to 6 with repeats allowed and read their total from the Sum in the results. For a coin, draw integers from 0 to 1 and read 0 as tails and 1 as heads. Raise the count to simulate many rolls or flips at once and see how often each value comes up.

What are the limitations of random number generators?

Pseudo-random generators are predictable to anyone who knows the seed, so they are not safe for passwords or keys, and they repeat after a very long period. Mapping bits onto a range can introduce bias if done with a plain remainder. True random generators are slower and cannot reproduce a result. Every generator also shows streaks and repeats in short runs, which is normal randomness, not a fault.

How do I generate a random decimal between 0 and 1?

Select Decimals, set the minimum to 0 and the maximum to 1, and choose the number of decimal places. With 4 decimal places the generator picks one of the 10,001 values from 0.0000 to 1.0000, each with the same probability.

Cite this page

Statculator. (2026, November 14). Random Number Generator. Retrieved November 14, 2026, from https://statculator.com/probability/random-number-generator/