Math Calculators

Random Number Generator

Generate random numbers in any range — for raffles, sample selection, games, password seeds, or anything you'd otherwise reach for dice or a hat to do. Choose the range, how many numbers, and whether duplicates are allowed.

Primary answer
Generated numbers
Inputs to verify
Minimum, Maximum, and Quantity
Use type
Use as a direct calculation check.
Keyword intent
random number generator

Calculator

Random Number Generator

Calculates generated numbers from minimum, maximum, quantity. Defaults are filled in so you can review a working example before changing inputs.

Lower bound for generated values.

Upper bound for generated values.

How many values to generate.

Integer mode includes both endpoints. Decimal mode generates values from minimum up to maximum and rounds for display.

More inputs3 additional assumptions

Decimal places used when number type is Decimal.

No duplicates is supported for integer mode.

Deterministic packet seed. Production UI should inject random values instead of using a predictable seed.

Result

Result reflects the current submitted inputs.

  • Risk A
  • Reviewed 2026-05-26
  • 2 sources
Generated numbers36
Quantity generated1
Lowest generated36
Highest generated36
Sum36
RangeInclusive integers from 1 to 100
Randomness modeDeterministic seeded mode for reproducible fixtures
  • Integer mode treats minimum and maximum as inclusive safe integers.
  • Decimal mode generates values from minimum up to maximum and rounds final outputs to the selected decimal places.
  • No-duplicate mode is supported for integer output only.
  • The packet uses deterministic seeded pseudo-random values so tests are reproducible.
  • This module does not use global randomness, DOM APIs, network APIs, or time.
  • A production UI should inject unbiased random indexes or random bytes from the runtime instead of relying on a predictable seed.

Accuracy notes

Risk level
A
Reviewed
2026-05-26
Sources
2
Primary result
Generated numbers

Formula logic is kept in a pure calculator module with fixtures, source notes, and page-visible assumptions.

What the result means

Each number drawn is independent and uniformly distributed across the range you set, meaning every integer in the range has the same chance of being picked. Don't read patterns into short sequences — true randomness can produce runs (three odd numbers in a row, etc.) that look non-random but are.

Generated numbersComma-separated generated values.
Quantity generatedNumber of values returned.
Lowest generatedSmallest generated value.
Highest generatedLargest generated value.

Use the result this way

  1. Start with Generated numbers, then use supporting outputs for context.
  2. Verify Minimum, Maximum, and Quantity before copying the result.
  3. Check the formula, example, and assumptions before reusing the answer.

User job

How to use this calculator

Use Random Number Generator when you need generated numbers, then use quantity generated and lowest generated to check the context for quick number work, classwork, spreadsheet checks, and explaining a calculation to someone else.

Best for

  • Checking the core numeric relationship
  • Comparing the main result with supporting outputs
  • Reviewing a default example before entering your own minimum and maximum.

Check before relying

  • Confirm sign, decimal, percent, and rounding assumptions before copying the number.
  • Integer mode treats minimum and maximum as inclusive safe integers.
  • Decimal mode generates values from minimum up to maximum and rounds final outputs to the selected decimal places.
  • Source context: NIST, reviewed 2026-06-23.

Next useful step

  • Basic CalculatorUse next when your task shifts from Random Number Generator to Basic Calculator.
  • Scientific CalculatorUse next when your task shifts from Random Number Generator to Scientific Calculator.
  • Percentage CalculatorUse next when your task shifts from Random Number Generator to Percentage Calculator.

Formula

Most online random number generators use a pseudo-random number generator (PRNG) — an algorithm that produces a long, statistically random sequence from a seed value. Common algorithms include the Mersenne Twister, xorshift, and PCG. The browser's Math.random() is a PRNG; window.crypto.getRandomValues() uses a cryptographically secure source (CSPRNG) seeded from system entropy.

  • Pseudo-random (PRNG) vs true random (TRNG): PRNGs are deterministic given the same seed; TRNGs use physical entropy (atmospheric noise, hardware noise). PRNGs are fine for raffles and games; TRNGs are needed for cryptographic keys.
  • Cryptographic security: standard Math.random() is not safe for passwords, tokens, or secrets — use a CSPRNG (e.g. crypto.getRandomValues) or a dedicated password generator.
  • Without duplicates: the maximum count is bounded by the range size. Range 1–10 with no duplicates can produce at most 10 numbers.
  • Inclusive bounds: both the minimum and maximum are possible outcomes. To get 1–6 for a die, set min=1 and max=6.
  • Reproducibility: a seeded PRNG with the same seed produces the same sequence — useful for simulations and testing, less useful for fair draws.

Inputs

Set the minimum and maximum to define the range (both inclusive in most tools). Choose how many numbers to draw. If you turn off duplicates, the draw is sampling without replacement — useful for raffles where the same ticket should not win twice.

MinimumLower bound for generated values.
MaximumUpper bound for generated values.
QuantityHow many values to generate.
Number typeInteger mode includes both endpoints. Decimal mode generates values from minimum up to maximum and rounds for display.
Decimal placesDecimal places used when number type is Decimal.
Allow duplicatesNo duplicates is supported for integer mode.
Deterministic seedDeterministic packet seed. Production UI should inject random values instead of using a predictable seed.

Example

Pick 1 number between 1 and 100: a single integer like 47. Draw 6 numbers between 1 and 49 without duplicates: a lottery-style sample like 3, 11, 22, 28, 35, 44. Simulate a six-sided die: a number between 1 and 6.

FAQ

How does an online random number generator work?

It runs a pseudo-random number generator (PRNG) algorithm in your browser, producing a sequence of numbers that look statistically random. The seed comes from system time or browser entropy, so each visit gives different numbers.

Is a random number generator truly random?

Most online generators are pseudo-random — deterministic algorithms that produce statistically random output. For most uses (raffles, games, sampling) this is indistinguishable from true randomness. Cryptographic keys need a CSPRNG or a hardware random source.

Can I use this for a raffle or giveaway?

Yes. Set the range to cover your entries (e.g. 1 to 500 for 500 tickets), set count to the number of winners, and turn off duplicates so the same entry can't win twice. Save a screenshot of the result for transparency.

Why does the same number sometimes repeat?

If duplicates are allowed, each draw is independent — getting the same number twice in a row is a real possibility, especially in small ranges. Turn off duplicates if you need a unique sample.

Can a random number generator be rigged?

Server-side generators can be, in principle. Client-side browser generators that draw fresh entropy at the moment of click are harder to manipulate. For high-stakes draws (regulated lotteries), use a certified RNG with audit logs.

What's a good range for a coin flip or die?

Coin flip: 1 to 2 (1 = heads, 2 = tails). Six-sided die: 1 to 6. Twenty-sided die (D20): 1 to 20. Two dice summed: draw two values in 1–6 separately and add them — drawing one value in 2–12 is not the same distribution.

Sources

Last reviewed: 2026-05-26

Disclaimer

This generator is suitable for raffles, games, sampling, and casual use. It is not certified for regulated lotteries, gambling, or cryptographic key generation — use a certified RNG or a CSPRNG library for those purposes.