Skip to content
aiocalc.com

Popular

    Math

    Random Number Generator – Pick a Number

    Pick a random number between any two values, draw several without repeats, choose a winner from a list of names, roll dice or flip a coin. Press Enter or Generate for a fresh result.

    Settings

    Generate

    Results

    Random number

    —

    Details

    —

    Previous results (this visit only)

    1. Nothing yet.

    The shareable link saves your settings, not the result, so whoever opens it draws fresh numbers. Randomness comes from your browser's built-in cryptographic generator; nothing is sent to a server.

    How to use the random number generator

    Pick a mode, adjust the settings, and press Generate (or just hit Enter in any field). Each press makes a completely new draw.

    • Number: a random number between a minimum and maximum, both included. Ask for up to 1,000 at once, choose whether repeats are allowed, set 0–6 decimal places, and optionally sort the output. "Pick a number between 1 and 10" is just min 1, max 10, how many 1.
    • List: paste names, tasks, prizes or anything else, one per line, and pick one or several without replacement. Picking every item gives you a shuffled order, which is handy for presentation slots or turn order.
    • Dice: roll up to 100 dice of 4, 6, 8, 10, 12, 20 or 100 sides and see each roll plus the total, for board games, tabletop RPGs or probability lessons.
    • Coin: flip one coin to settle a decision, or up to 1,000 to watch the heads/tails split settle toward 50%.

    With repeats turned off, you can't ask for more numbers than the range holds: 20 unique numbers from 1–10 is impossible, and the tool tells you instead of quietly repeating. Decimals work the same way. A range of 0–1 with two decimal places has 101 possible values (0.00, 0.01 … 1.00), each equally likely.

    How the numbers are generated (and why there's no modulo bias)

    Every result starts with crypto.getRandomValues, the cryptographically secure random source built into modern browsers. It is the same kind of generator used for encryption keys, and it is seeded by your operating system from unpredictable hardware events. It hands back raw 32-bit numbers: whole numbers from 0 to 4,294,967,295.

    Turning that into, say, a die roll needs care. The obvious shortcut is to take the remainder after dividing by 6, but 4,294,967,296 possible values don't split evenly into 6 groups: 4 values are left over, so faces 1–4 would come up very slightly more often than 5 and 6. With 32-bit numbers the tilt is tiny, but the same shortcut on a single byte (256 values) makes faces 1–4 show up 43 times in 256 against 42 for 5 and 6, a clear bias.

    This generator uses rejection sampling instead. It works out the largest multiple of your range that fits in the raw values, throws away any draw that lands in the leftover sliver above it, and draws again. Every outcome then has exactly the same number of raw values behind it, so every number in your range is equally likely. Lists are shuffled with the Fisher–Yates method using that same unbiased step, so every item, and every order, has an equal chance.

    True random vs. pseudo-random numbers

    A true random number generator measures a physical process that can't be predicted, such as electrical noise or radioactive decay. A pseudo-random number generator (PRNG) is a formula: give it a starting value, called a seed, and it produces a long sequence that looks random but is completely determined by that seed. Run it again with the same seed and you get the same numbers, which is exactly what scientists want for repeatable simulations.

    A cryptographically secure PRNG sits in between. It is still an algorithm, but it is continuously seeded with real-world entropy collected by the operating system, and it is designed so that seeing past outputs doesn't help anyone predict the next one. For raffles, classroom picks and games, that is as good as true randomness. JavaScript's everyday Math.random() makes no such security promise, which is why this page doesn't use it.

    Chance of getting a repeat: the birthday problem

    With repeats allowed, duplicates turn up far sooner than intuition suggests. The chance that n picks from N equally likely values are all different is 1 × (1 − 1/N) × (1 − 2/N) × … × (1 − (n−1)/N), so the chance of at least one repeat is one minus that. The classic example is birthdays: in a group of just 23 people, it is slightly more likely than not that two share a birthday (ignoring leap days and assuming birthdays are spread evenly).

    PicksFromChance of at least one repeat
    51–1069.8%
    61–4927.3%
    101–10037.2%
    23365 days (birthdays)50.7%
    301–1,00035.6%
    50365 days (birthdays)97.0%

    So drawing 10 numbers from 1–100 with repeats allowed gives at least one duplicate more than a third of the time. When you turn repeats on and ask for two or more numbers, the tool shows this percentage for your exact settings. If a duplicate would spoil the result (raffle tickets, seat numbers, lottery-style picks), leave repeats off. For other "what are the odds" questions, the probability calculator handles combined events and binomial chances.

    Raffles, classroom picks and games

    Raffles and giveaways. Number the tickets and draw from 1 to the number sold with repeats off. Or paste the entrant names into the List picker. To make the draw easy to trust, show it live on screen, decide in advance how many winners and runners-up you'll draw, and keep a copy of the entry list. Rules for raffles and sweepstakes differ by state and country, so check local requirements before running a paid-entry raffle.

    Classrooms. Paste the class roster and pick one name to cold-call, or pick everyone to set presentation order. Because picks within one draw never repeat, nobody is called twice before everyone has had a turn. Random group assignment works the same way: shuffle the full list and count off groups of four.

    Decisions, games and sampling. Flip a coin to break a tie, roll a d20 for a tabletop game, or pick 30 random row numbers from 1 to 2,000 to spot-check a spreadsheet or survey file. Random sampling like this is what keeps an audit or quality check from being skewed by which rows you happen to look at.

    Dice and coin flip odds

    Every face of a fair die is equally likely: 1 in 6 on a d6, 1 in 20 on a d20. Totals are a different story. With two six-sided dice there are 36 equally likely combinations, and six of them add up to 7, so 7 comes up 1 time in 6 (about 16.7%). A 2 or a 12 needs one exact combination each, just 1 in 36 (about 2.8%). The average of a single d6 roll is 3.5, and if you roll many dice and paste the results into the average calculator, you'll see the mean settle close to that.

    A fair coin lands heads half the time, but short runs are lumpy. In 10 flips, getting exactly 5 heads happens only 252 times out of 1,024 possible sequences, about 24.6%. Streaks of four or five of the same side are normal. Past flips don't make the other side "due": each flip is independent, and believing otherwise is known as the gambler's fallacy. Flip 1,000 coins at once and the heads share usually lands within a few percentage points of 50%.

    Frequently asked questions

    Can I use this to pick lottery numbers?

    Yes. Set the range your lottery uses, choose how many numbers, leave repeats off and sort ascending, and you get a valid-looking ticket. Bear in mind that no method improves your odds: every combination is equally likely to be drawn. Random picks do help you avoid popular patterns like birthdays, which means fewer people to share a prize with if you do win.

    Why did I get the same number twice in a row?

    Each draw is independent, so the generator has no memory of the last result. With a range of 1–100, the next number matches the previous one 1 time in 100, which over many clicks happens more often than people expect. If you never want a repeat within one batch, generate all the numbers at once with "Allow repeats" turned off.

    How do I pick a random winner from a list of entries or comments?

    Copy the names or usernames, paste them into the List picker one per line, and press Pick. Each line is one ticket, so someone listed twice has twice the chance. Remove duplicate lines first if the rule is one entry per person. For transparency, share your screen or record the draw, and note the time and the full list you used.

    Can I get the same random numbers again later?

    No. The numbers come from your browser's cryptographic generator, which can't be seeded or replayed, and results are deliberately left out of the shareable link. Copy or screenshot a result you need to keep. If you need repeatable "random" numbers for a simulation or a class demo, use a seeded generator in a spreadsheet, Python or R instead.

    How do I generate random numbers in Excel or Google Sheets?

    Use =RANDBETWEEN(1,100) for a whole number between 1 and 100, or =RAND() for a decimal between 0 and 1. In Excel 365 and Google Sheets, =RANDARRAY(10,1,1,100,TRUE) fills ten cells with whole numbers. These functions recalculate whenever the sheet changes, so paste the results as values if you need them to stay put.