Random Number Generator

Generate random whole numbers within any range, with or without repeats

Frequently Asked Questions

Is this truly random?
It uses your browser's built-in pseudorandom number generator (Math.random()), which is suitable for games, raffles, and everyday random-selection needs, but not for cryptographic or security purposes.
Is my data sent anywhere?
No. Everything is generated locally in your browser.

Generating random whole numbers within a specified range, with or without allowing repeats, relies on the same genuine-randomness property discussed for dice rolling — every number within the specified range should have an equal chance of being generated on each draw, and "without repeats" mode needs to track and exclude already-generated numbers correctly across multiple draws.

Why range and repeat settings both need careful handling

A properly random number generator, given a specified minimum and maximum, should produce each integer in that range with equal probability — not favoring numbers near the middle, edges, or any other pattern that would make the output distinguishable from genuine randomness. The "without repeats" setting changes the underlying process meaningfully: rather than each draw being fully independent (as it is in "with repeats" mode), each draw needs to exclude numbers already generated in that same session, which means the probability of any specific remaining number changes slightly with each draw — this is fundamentally different from independent draws, similar to drawing cards from a shrinking deck rather than rolling dice repeatedly.

A worked example

Requesting several unique random numbers from a range without repeats produces a result where each number can appear at most once, unlike requesting the same number of draws with repeats allowed, where the identical number could theoretically be drawn multiple times — these represent genuinely different underlying random processes, not just a display-formatting difference.

How this connects to your other everyday tools

This calculator shares its underlying randomness requirements with Dice Roller (a bounded range with a fixed number of faces) and Password Generator (randomness combined with character-set requirements) — all three depend on the same genuine-randomness property, just applied to different output formats and use cases.

Common mistakes

Assuming "without repeats" mode works identically to running "with repeats" mode multiple times and simply discarding duplicates after the fact is a common misconception — properly implemented without-repeats generation adjusts the probability calculation for each subsequent draw, rather than generating independently and filtering afterward, which matters for genuinely uniform distribution across the full set of unique outcomes.

Related Calculators

Exponent CalculatorPercent Error CalculatorVolume CalculatorTriangle CalculatorOvulation CalculatorStandard Deviation Calculator