Skip to calculator
Calculate This

Random Number Generator

Pick random numbers between any minimum and maximum, with or without repeats, or switch to a coin flip, dice roll or lottery quick pick.

Defaults to your region. Switch to compare any other scale.

Whole numbers between a minimum and a maximum, with or without repeats.

Repeats
Order

Result

—

Your random number

Press Generate to draw numbers.

    Fair and private

    Numbers come from your browser's cryptographic random generator (crypto.getRandomValues) and are drawn without modulo bias, so every allowed value is equally likely. Nothing is sent to a server. Press Generate for a new draw.

    About this tool

    How it works: the numbers come from your browser's cryptographic generator, crypto.getRandomValues, the same source used for encryption keys. Each 32-bit random word is turned into a number in your range with rejection sampling, which throws away the few values that would make some numbers more likely, so every value from the minimum to the maximum has exactly the same chance. Draws without repeats use a Fisher–Yates shuffle.

    Lottery quick picks: the Standard menu includes Powerball and Mega Millions (US), EuroMillions, Eurojackpot and Vikinglotto (Europe), Lotto 6aus49, UK Lotto, SuperEnalotto, La Primitiva, Latloto, Loto 6, Loto 7, Korea's Lotto 6/45, China's Shuangseqiu and Daletou and the UAE Lottery. Each pick follows the official format and shows the jackpot odds, for example 1 in 292,201,338 for Powerball.

    Related tools: work out shares and chances with the percentage calculator, summarize a list of results with the statistics calculator or create a strong password.

    Formula

    • Probability of each value = 1 ÷ (max − min + 1)
    • Value = min + (r mod n), where n = max − min + 1 and a 32-bit word r is redrawn if r ≥ 2³² − (2³² mod n)
    • No repeats: partial Fisher–Yates shuffle of the range
    • Lottery odds = C(main pool, main picks) × C(extra pool, extra picks), C(n, k) = n! ÷ (k! (n − k)!)
    • Dice: expected total = number of dice × (sides + 1) ÷ 2

    How it is calculated

    1. Choose a mode in the Standard menu: number range, coin flip, dice roll or one of the lotteries.
    2. For a range, enter the minimum, the maximum and how many numbers you need.
    3. Choose whether repeats are allowed and how the numbers should be ordered.
    4. Press Generate. Every press makes a completely new draw.
    5. Use Copy to save the result, or read the probability rows to see how likely it was.

    Questions

    Is this random number generator truly random?

    It uses crypto.getRandomValues, the cryptographically secure generator built into every modern browser. The operating system seeds it from hardware events, and its output cannot be predicted in practice, which is far stronger than Math.random() or a spreadsheet's RAND(). Numbers are mapped to your range with rejection sampling, so there is no bias towards smaller values. It is ideal for games, classroom picks and giveaways, but regulated lotteries and casinos must use certified equipment.

    How do I pick several numbers without repeats?

    Set the minimum and maximum, enter how many numbers you need and choose “No repeats”. Each number can then appear only once, like balls taken out of a drum; the tool uses a Fisher–Yates shuffle so every possible set is equally likely. The count cannot be larger than the range: from 1 to 10 you can draw at most 10 different numbers. “Smallest first” sorts the result, which is handy for lottery-style picks.

    How do I use it to choose a giveaway winner?

    Number the entries from 1 to N (for example, in the order of the comments), set the range to 1–N and generate one number. For several winners, set the count and choose “No repeats” so nobody wins twice. For transparency, announce the range and the method first and record your screen while you press Generate.

    Can a number generator improve my lottery chances?

    No. Each draw is independent and every combination has exactly the same chance, whether it is 1-2-3-4-5-6, your birthday or a random pick, and past results do not make any number “due”. The one practical advantage of random picks is that they avoid patterns many people choose, so a jackpot is less likely to be split. Only spend what you can afford to lose.

    What are the jackpot odds for each lottery?

    Jackpot odds for one line, as calculated from each game's official format: Powerball: 1 in 292,201,338; Mega Millions: 1 in 290,472,336; EuroMillions: 1 in 139,838,160; Eurojackpot: 1 in 139,838,160; Vikinglotto: 1 in 61,357,560; Latloto: 1 in 5,019,420; Lotto 6aus49: 1 in 139,838,160; UK Lotto: 1 in 45,057,474; SuperEnalotto: 1 in 622,614,630; La Primitiva: 1 in 139,838,160; Loto 6: 1 in 6,096,454; Loto 7: 1 in 10,295,472; Lotto 6/45: 1 in 8,145,060; Shuangseqiu (双色球): 1 in 17,721,088; Daletou (大乐透): 1 in 21,425,712; UAE Lottery Lucky Day: 1 in 8,835,372. Lower prizes are much more likely, but no method of choosing numbers changes these odds.

    Are the coin flip and dice fair?

    Yes. Each flip is exactly 50/50 and each face of a die has a chance of 1 ÷ sides, with no physical imperfections. With several dice the totals are not equally likely: with two six-sided dice, 7 is the most common total (6 of 36 combinations, about 16.7%), while 2 and 12 each come up only once in 36. The expected average total is number of dice × (sides + 1) ÷ 2, so 7 for 2d6.

    Sources

    Related calculators