Random Number Generator

Random whole numbers in a range. Change the seed to draw a new set.

Enter details

Random numbers

61, 45, 86, 67, 18

Sum
277

Formula: Uniform integers between min and max (seeded pseudo-random)

Random Number Generator: Seeded Range Formula & Examples

Short answer

A random number generator produces discrete, uniformly distributed integers between a specified minimum and maximum value using a deterministic pseudo-random seed. With a range of 1 to 100, a count of 5, and seed 42, the tool generates 61, 45, 86, 67, and 18, which sum to 277. Using the same seed guarantees identical, verifiable results every time.

Formula

X = a + floor(R × (b - a + 1)), where a = ceil(min(lo, hi)), b = floor(max(lo, hi)), and R ∈ [0, 1)

X is the generated random integer within the closed interval [a, b]. 'lo' and 'hi' are the user-provided bounds. 'a' is the lower integer boundary calculated by taking the ceiling of the minimum input. 'b' is the upper integer boundary calculated by taking the floor of the maximum input. 'R' is a standard uniform pseudo-random decimal strictly greater than or equal to 0 and strictly less than 1, generated from the numeric seed. 'floor' rounds down to the nearest integer.

Worked example

Minimum
1
Maximum
100
How many numbers
5
Seed (change for new numbers)
42
  • Random numbers: 61, 45, 86, 67, 18
  • Sum: 277

What It Calculates and Who It's For

A random number generator produces discrete, uniformly distributed integers across a chosen numerical range. Unlike physical random processes, such as rolling dice or measuring atmospheric noise, digital generators typically use a pseudo-random number generator (PRNG). A PRNG processes an initial numerical input—known as a seed—through an algebraic formula to return a deterministic sequence of digits that mimics true randomness.

This calculator is designed for students, researchers, data analysts, educators, and developers who need:

  • Quick sample sets for classroom demonstrations and probability exercises.
  • Unbiased integer selection for raffles, board games, or priority lists.
  • Replicable simulation data where maintaining the exact same results via a documented seed is essential for peer verification or debugging.

Each generated number is chosen independently from the closed interval [Minimum, Maximum]. That means every whole number in the span has an identical chance of being picked on every draw.


Step-by-Step Worked Example

To understand how the algorithm translates inputs into output values, consider the following baseline parameters:

  • Minimum (lo): 1
  • Maximum (hi): 100
  • Count (k): 5
  • Seed: 42

Step 1: Establish Valid Integer Bounds

The formula checks the inputs to define bounds a and b: $$ a = \lceil \min(1, 100) \rceil = 1 $$ $$ b = \lfloor \max(1, 100) \rfloor = 100 $$ The span of possible whole numbers is: $$ b - a + 1 = 100 - 1 + 1 = 100 $$

Step 2: Generate Uniform Floating-Point Values

The PRNG uses the seed 42 to produce a sequence of deterministic decimal fractions strictly between 0 and 1 ($R \in [0, 1)$). Suppose the internal generator produces the following initial five fractions:

  1. $R_1 \approx 0.6015$
  2. $R_2 \approx 0.4431$
  3. $R_3 \approx 0.8522$
  4. $R_4 \approx 0.6689$
  5. $R_5 \approx 0.1740$

Step 3: Scale and Shift to the Target Interval

Each random fraction is multiplied by the span (100), floored to drop the decimal, and offset by the minimum ($a = 1$): $$ X_1 = 1 + \lfloor 0.6015 \times 100 \rfloor = 1 + 60 = 61 $$ $$ X_2 = 1 + \lfloor 0.4431 \times 100 \rfloor = 1 + 44 = 45 $$ $$ X_3 = 1 + \lfloor 0.8522 \times 100 \rfloor = 1 + 85 = 86 $$ $$ X_4 = 1 + \lfloor 0.6689 \times 100 \rfloor = 1 + 66 = 67 $$ $$ X_5 = 1 + \lfloor 0.1740 \times 100 \rfloor = 1 + 17 = 18 $$

Output List: 61, 45, 86, 67, 18
Sum: $61 + 45 + 86 + 67 + 18 = 277$


How to Read and Evaluate the Results

When evaluating a set of random numbers, observe these standard statistical benchmarks:

  • Expected Mean: For a discrete uniform distribution, the theoretical mean is $(a + b) / 2$. For a range of 1 to 100, the expected mean is $50.5$. In our sample, the sample mean is $277 / 5 = 55.4$, which is well within expected variance for a small sample size ($k = 5$).
  • Independent Draws (With Replacement): Because selections are independent, observing a duplicate number (e.g., getting 45 twice in a larger batch) is normal and mathematically expected under the birthday paradox principles.
  • Seed Determinism: If you share the parameters lo=1, hi=100, k=5, and seed=42, anyone using this algorithm receives the exact sequence 61, 45, 86, 67, 18. Changing the seed to any other value instantly yields an entirely different set of numbers.

Practical Tips for Best Results

  1. Vary the Seed for New Draws: If you want a fresh draw, increment or alter the seed field (e.g., set it to today's date or current time).
  2. Double-Check Range Width: If you draw 50 numbers from a narrow range (such as 1 to 5), you will receive many duplicate values. Expand the range if high uniqueness is preferred.
  3. Preserve Seed Data for Audits: If you run a drawing or select items for review, take a screenshot or record the seed. This allows any participant to verify that the selection was computed fairly without cherry-picking.

When Not to Rely on This Calculator

While ideal for general-purpose math, classroom lessons, and quick random selections, seeded pseudo-random generators have strict limitations:

  • Cryptography and Authentication: Do not use this tool to generate password reset tokens, encryption salts, or private API keys. PRNG sequences can be reverse-engineered if the underlying state is discovered.
  • Official Lotteries or Gaming Compliance: Commercial gaming and legal prize drawings mandate hardware-based true random number generators (TRNGs) certified by regulatory authorities.
  • Sampling Without Replacement: If you require a strictly unique list (such as shuffling a 52-card deck), this tool does not guarantee uniqueness because each draw is processed independently.

Comparison

ScenarioInputResult
Lower inputMinimum: 0.8Random numbers: 61, 45, 86, 67, 18
Base exampleMinimum: 1Random numbers: 61, 45, 86, 67, 18
Higher inputMinimum: 1.2Random numbers: 61, 46, 86, 68, 19

Common mistakes

  • Assuming uniform random generation prevents duplicates (sampling occurs with replacement).
  • Using non-cryptographic pseudo-random generators for passwords, encryption keys, or regulated gaming.
  • Entering non-integer bounds without realizing the formula rounds the minimum up and the maximum down to preserve integer boundaries.
  • Forgetting to document the seed value when conducting scientific simulations or classroom audits that require exact replication.
  • Believing past outcomes influence upcoming numbers (the gambler's fallacy).

Checklist

  • Define clear inclusive minimum and maximum limits for your range.
  • Choose how many integers you need (up to 50 values per batch).
  • Record your seed value if you need to reproduce or audit your results later.
  • Change the seed to generate an entirely new sequence of numbers.
  • Verify whether your application permits duplicate values, as uniform sampling with replacement can repeat numbers.
  • Ensure non-cryptographic pseudo-random numbers are acceptable for your specific use case.

Calculators Percentage Editorial Team

Calculator guides from the Calculators Percentage team. These introductory examples are educational, not professional advice.

Last reviewed:

This utility utilizes a seeded pseudo-random algorithm for modeling, education, and general utility. It is not intended for cryptographic security, sensitive authentication, or regulated gambling systems.

Frequently Asked Questions

What is a pseudo-random number generator?

A pseudo-random number generator (PRNG) is an algorithm that uses mathematical formulas to produce sequences of numbers that appear random. Because it relies on an initial value called a seed, the sequence is completely deterministic and reproducible whenever the same seed is used.

Why does entering the same seed give the same numbers?

PRNG algorithms execute a fixed series of arithmetic operations starting from the seed number. When the starting seed and parameters remain unchanged, the mathematical operations progress through the exact same states, returning identical output values every single time.

Can this random number generator produce duplicates?

Yes. The algorithm evaluates each selection independently with replacement. In any discrete uniform distribution, every integer between the minimum and maximum has an equal probability of appearing on each draw, meaning repeats can naturally occur.

What happens if the minimum is higher than the maximum?

The algorithm automatically detects the smaller and larger values using minimum and maximum functions. It assigns the lower value to the bottom bound 'a' and the higher value to the top bound 'b', ensuring valid numbers are generated regardless of input order.

How does fractional input affect the range?

The generator forces boundaries to integers by applying the ceiling function to the lower bound and the floor function to the upper bound. For example, a minimum of 1.2 is rounded up to 2, which changes the available integer pool.

Is this generator secure for cryptography or lotteries?

No. Standard seeded PRNG algorithms are designed for simulations, statistical sampling, games, and modeling. They are not cryptographically secure and should never be used for generating security tokens, private keys, or high-stakes financial contests.

Sources & references

Formulas are tested against hand-checked answers. How we check our calculators.

Estimates only. Confirm final figures, terms and fees with your bank, provider or a qualified professional.

Last updated: January 15, 2026