Random tools · Free tool

Random Number Generator: Pick Fair Random Numbers in Any Range

Quick answer

Enter the smallest and largest number you want, choose how many numbers to draw and press Generate. Every whole number in the range has exactly the same chance, each draw is independent, and you can tick No duplicates to draw several different numbers for a raffle or giveaway.

Key facts
RangeAny whole numbers, from negative values up to one trillion apart
Numbers per draw1 to 1,000
Randomness sourcecrypto.getRandomValues (cryptographically secure)
BiasNone: rejection sampling removes modulo bias
Data sent anywhereNothing. It runs entirely in your browser

Use this random number generator to pick a fair number in any range, or a whole set of numbers at once. Set the minimum and maximum, choose how many numbers you need, and press Generate. It runs in your browser with cryptographic randomness, so every number has exactly the same chance.

Random number generator

?

    Chance of any one number: 1 in 100

    Quick ranges: 1–10 · 1–100 · 1–4 · 1–6 · 1–20 · 1–3 · 1–5 · 1–8 · 1–30 · 1–50 · 4-digit

    How this random number generator works

    Computers can't flip coins, so they generate randomness in one of two ways. Simple generators, like the Math.random function many websites use, produce a sequence that looks random but is meant for games and animations, not fairness. This tool uses crypto.getRandomValues instead. MDN, the reference documentation for web developers, describes it as a cryptographically strong source seeded from unpredictable system data, and it's what browsers rely on for security.

    There's one more trap, called modulo bias. A raw random value has 4,294,967,296 possible results. If you squeeze that into, say, 1 to 10 with simple division, a few numbers get one extra way to appear. The difference is tiny, but it's real. Our generator throws away the handful of raw values that would cause it and draws again, so every number in your range is exactly equally likely.

    P(any one number) = 1 ÷ (max − min + 1)

    From 1 to 100 that's 1 ÷ 100 = 1%. From 1 to 6 it's 1 ÷ 6 ≈ 16.67%, the same as a fair die.

    True random vs pseudorandom

    A "true" random number generator measures something physical, such as electrical noise or radioactive decay. A pseudorandom generator uses a formula. Cryptographic pseudorandom generators sit in between: they start from unpredictable physical events collected by your device, then stretch them with a formula that can't be predicted without knowing that starting point.

    For picking raffle winners, settling a decision or running a classroom game, a cryptographic generator is as good as a physical one: nobody, including us, can predict or influence the next result.

    Picking numbers for a giveaway, raffle or draw

    1. Number your entries. Export your list of entrants and number them 1 to N.
    2. Set the range from 1 to N and How many numbers to the number of winners.
    3. Tick No duplicates, so nobody can win twice.
    4. Generate once and record the result, ideally on screen.

    The most common mistake is drawing again "just to check". Once you redraw until you like the answer, the result is your choice, not chance.

    Why streaks and "due" numbers fool people

    Random results clump. We simulated 100,000 sequences of 100 draws from 1 to 10: about 59% contained the same number three times in a row, and about 99% had at least one number that went missing for 30 draws or more. That's normal. Britannica calls the belief that a missing number is "due" the doctrine of the maturity of the chances, better known as the gambler's fallacy: when each draw is independent, past results don't change future chances.

    The same idea matters in casino games. A roulette wheel, a crypto dice roll and this generator all have no memory. Our chance calculator shows how often streaks of any length turn up, and our crypto dice guide explains how provably fair games let you verify each random result after the fact.

    More random tools

    • Dice roller: roll d4 to d100 with a total and its exact probability.
    • Coin flip: heads or tails, or flip 100 coins at once.
    • Spin the wheel: a yes-or-no wheel or your own list of names.

    Frequently asked questions

    Is this a true random number generator?

    It uses your browser's cryptographically secure generator, which is seeded from unpredictable hardware and system events. Strictly speaking that is a cryptographic pseudorandom generator, not a physical 'true' random source, but for picking numbers it's unpredictable and unbiased. It's the same source browsers use for encryption keys.

    Can I use it to pick giveaway winners?

    Yes. Number your entries, set the range to match, set How many numbers to the number of winners and tick No duplicates. Decide the rules before you press Generate and use the first result, otherwise the draw stops being random.

    Why did the same number come up twice?

    Because each draw is independent. With 10 possible numbers, the chance that a second draw matches the first is 1 in 10. Repeats are normal; if you don't want them, tick No duplicates.

    Does a number become 'due' if it hasn't come up for a while?

    No. The generator has no memory, so a number that hasn't appeared in 50 draws has the same chance on the next draw as every other number. Believing otherwise is the gambler's fallacy.

    Sources

    1. Crypto: getRandomValues() method — MDN Web Docs
    2. Doctrine of the maturity of the chances — Encyclopaedia Britannica. Gambler's fallacy: falsely assumes plays are dependent