Random Number Generator Guide: How Random Numbers and Odds Work
Written and verified by Muhammad Haroon, founder of Numblox · How randomness works in plain English · Duplicates on or off · Real odds for dice & lotteries · Updated 23 November 2026
"Pick a random number" sounds simple until you ask what random actually promises: every value in the range equally likely, every draw independent of the last, and no pattern to exploit. This guide explains how the Numblox generator keeps those promises — it uses the same cryptographic randomness your browser uses for security — and then works through the odds questions people actually ask, from dice to lotteries, with every probability verified by calculation.
Try it yourself: use the free Random Number Generator on Numblox — set a smallest and largest number, choose how many to draw, and allow duplicates or forbid them. Nothing you enter is stored or sent anywhere; the numbers are drawn locally in your browser.
What this generator does
You give it a range (smallest to largest, whole numbers) and a count (how many numbers to draw), plus one choice: duplicates allowed — each draw is independent, so the same number can appear twice — or duplicates prevented — each number can appear at most once, like dealing cards or drawing raffle tickets. If you ask for more different numbers than the range contains (say, 101 unique numbers from 1 to 100), it stops with an explanation rather than looping forever: that request is impossible, not unlikely.
Under the hood, the draws come from crypto.getRandomValues, the browser's cryptographic random source — the same quality of randomness used for security tokens and by our Password Generator. The generator also uses a technique called rejection sampling when it converts random data into your range: values that would bias the result toward certain numbers are discarded and redrawn, so every number in your range is exactly equally likely. That fairness is a design choice, not an accident — a naive conversion can quietly make small numbers slightly more likely than large ones. In testing, 200 draws from 1 to 6 landed entirely inside the range as whole numbers, and a no-duplicates draw of 10 numbers from 1–10 returned each number exactly once, as it must.
Duplicates: the choice that changes everything
With duplicates allowed, each draw is a fresh spin: drawing 6 numbers from 1–6 can give 4, 4, 4, 4, 4, 4 — unlikely, but exactly as likely as any other specific sequence. This is the right mode for dice rolls, dice-like games and simulating chance. With duplicates prevented, the generator is dealing from a shrinking pool: each number drawn is removed, so later draws choose from fewer options. This is the right mode for raffles, picking teams, assigning turns and lottery-style draws. The odds feel different because they are different — preventing duplicates makes repeats impossible and makes the draw a selection of a set, which is why lottery maths (below) counts combinations, not sequences.
The odds, worked out
One number from 1–100: every value has the same chance, 1 in 100 — a 1% probability for any specific number you name in advance. In 100 draws with duplicates allowed, each number is expected to appear about once on average — but "on average" is doing real work in that sentence: some numbers will appear twice, some not at all, and that clumpiness is what genuine randomness looks like. A perfectly even spread would be suspicious, not random.
Two dice: there are 36 equally likely pairs. The total 7 can be made six ways (1+6, 2+5, 3+4, 4+3, 5+2, 6+1), so its probability is 6/36 = 16.67% — the most likely total, which is why 7 dominates dice games. The total 2 needs exactly one pair (1+1): 1/36 = 2.78%. And the chance of at least one 6 across two dice is 11/36 = 30.56% — higher than most people guess, because the pairs containing a 6 are more numerous than intuition suggests. You can reproduce all of these with the generator: draw pairs from 1–6 with duplicates allowed and tally the totals over a few hundred draws; the frequencies settle toward these percentages.
Coins: three heads in a row is (1/2)³ = 1/8 = 12.5% — common enough that a short streak proves nothing about the coin.
A 6-from-49 lottery: with duplicates prevented, the number of possible sets of 6 from 49 is the combination count 49-choose-6 = 13,983,816. Your ticket matches one specific set, so the jackpot chance is 1 in 13,983,816 — about 0.0000072%. Choosing "meaningful" numbers (birthdays, patterns) does not change that chance at all; it only changes how many other players you would share the prize with if you won, because birthdays cluster everyone else's picks into 1–31 too.
The gambler's fallacy, and other traps
Independent draws have no memory. If a number has not appeared in fifty draws, it is not "due" — its chance on the next draw is exactly what it always was, because the generator does not know or care what came before. The reverse trap is the hot-hand fallacy: a number appearing three times running is not "on a streak" either; three-in-a-row for a specific number from 1–100 is rare in advance (0.0001%), yet across many draws and many numbers, repeats and clusters happen constantly by pure chance. Randomness produces patterns to the eye; it just does not produce predictable ones. If a draw ever looks rigged because the same number appeared twice, remember that with duplicates allowed, a repeat somewhere in 10 draws from 1–100 is not a freak event — it is the expected behaviour of honest randomness.
Common questions
Is this random enough for a raffle or giveaway? Yes. The draws use cryptographic randomness with bias removed, which is a higher standard than physical raffle drums usually achieve. For a public draw, good practice is to announce the range and rules first, draw once, and keep the result — redrawing until you like the outcome is what would make it unfair, not the generator.
Can I use it instead of dice or a coin? Yes: set the range to 1–6 for a die (or draw two numbers for two dice), and 1–2 for a coin flip. The odds section above gives the exact probabilities your rolls follow over time.
Why did the same number come up twice in a row? Because with duplicates allowed, that is always possible — for a 1–100 range, any specific repeat is a 1-in-100 event on the second draw, and across a long session some repeat becomes likely. If repeats must not happen — a raffle, a draw without replacement — switch duplicates off and the generator guarantees uniqueness.
Should I use this to pick passwords or PINs? The randomness is strong enough, but use the right tool: the Password Generator builds full passwords with letters, digits and symbols and rates their strength. Never use a short numeric draw as a password for anything important — a 4-digit PIN has only 10,000 possibilities, however randomly it was chosen.
Check your own numbers
Open the Numblox Random Number Generator and try both modes on the same range — ten draws from 1–10 with duplicates allowed, then prevented — and feel the difference this guide described. Then draw two dice a few dozen times and watch the total 7 pull ahead, just as the 16.67% figure says it should.
Note: This article provides general information about probability. The odds quoted are exact mathematical probabilities for fair draws; no generator or system can improve your chance in a fair lottery or dice game, and gambling should never be treated as a way to make money.
Related: Random Number Generator · Password Generator · Fraction Calculator · All free calculators