Random Number Generator
Pick one or more random numbers in any range
Last updated October 2026
Method: Random bits come from the browser's cryptographically secure crypto.getRandomValues() (W3C Web Cryptography API). They are mapped to your inclusive range with the Simple Discard Method from NIST SP 800-90A Rev. 1 (Appendix A.5.1), which has no modulo bias. Unique draws use a partial Fisher-Yates shuffle so no value repeats.
Included: Custom min/max (including negatives, up to one quadrillion either way), any count up to 10,000, a unique (no-repeats) toggle, optional sorting, and summary stats for multi-number draws.
Not included: Certification for official lotteries, sweepstakes or regulated gaming, decimal output, weighted or non-uniform distributions, and seeds for repeating a draw. For passwords and keys, use a password manager.
๐ฒ Settings
๐ฒ Your random number
Press Generate to draw a number from 1 to 100.
Numbers come from your browser's cryptographically secure generator (crypto.getRandomValues) and are mapped to your range without bias, so every whole number in it is equally likely. Good for games, raffles, sampling and picking your own lottery numbers. This page is not certified for running official lotteries, sweepstakes or regulated gaming draws, and it is not a password manager. Nothing you enter or draw leaves your device.
Random number generator: everything you need to know
A random number generator (RNG) picks a number you cannot predict, drawn uniformly so every value is equally likely. Set the range to 1-100 with a count of 1 and you get a single fair pick where each number carries a 1-in-100 (1.00%) chance. Use it to roll dice, draw a raffle winner, pick a lottery line, pull an unbiased sample, or settle any "you decide" call.
This is the random-draw tool in our everyday set; for other quick jobs reach for the Tip Calculator to split a restaurant bill, the Age Calculator to count years and days between two dates, the Date Calculator to add or subtract days, or the Time Calculator to add up hours and minutes. Use this page whenever the answer needs to be unpredictable rather than calculated.
What "random" means here
Every integer in your range has the same probability of being chosen, and that is what makes the draw fair. This is called a uniform distribution: on a 1-6 generator each face has a 1-in-6 chance, exactly like a physical die. The generator does not "remember" past draws and does not avoid recently seen numbers, so streaks and repeats are normal and expected. There is no pattern to exploit and no number that is "due."
The formula behind the draw
The browser's crypto.getRandomValues() delivers random bits. Turning bits into a whole number in your range has one classic trap, called modulo bias. Take a random byte (0 to 255) and use "byte mod 6" as a die: 256 is not a multiple of 6, so the remainders 0 to 3 come up 43 times out of 256 (16.80%) and 4 and 5 only 42 times (16.41%). The generator avoids that with the Simple Discard Method from NIST Special Publication 800-90A Rev. 1, Appendix A.5.1:
N = max − min + 1 (how many whole numbers are in the range) c = m random bits, where m is the number of bits needed to write N − 1 if c < N: result = min + c, otherwise discard c and draw again For a die (N = 6), m is 3 bits, so c is a number from 0 to 7. The values 6 and 7 are thrown away and redrawn, which leaves 0 to 5 with exactly 1/6 each, and the result is 1 + c. NIST describes this method as producing a random number "with no skew (no bias)". The + 1 in N makes both ends of your range inclusive. For a draw of several numbers, the generator repeats this step, or, when you ask for unique values, it runs a partial Fisher-Yates shuffle of the range and keeps the first picks so nothing repeats.
What are the odds of picking a specific random number?
Because the draw is uniform, the chance of hitting one target value is simply 1 divided by how many integers the range contains. This table lists the per-number probability and the "1 in N" odds for the ranges people generate most.
| Range (inclusive) | Integers in range | Chance of any one value | Odds |
|---|---|---|---|
| 1 to 2 | 2 | 50.0000% | 1 in 2 |
| 1 to 6 | 6 | 16.6667% | 1 in 6 |
| 0 to 9 | 10 | 10.0000% | 1 in 10 |
| 1 to 20 | 20 | 5.0000% | 1 in 20 |
| 1 to 100 | 100 | 1.0000% | 1 in 100 |
| 1 to 1,000 | 1,000 | 0.1000% | 1 in 1,000 |
How to use this random number generator
- Set the minimum and maximum. These are the smallest and largest numbers that can be drawn, and both are included in the range. Negatives are allowed.
- Choose how many numbers you want in a single draw: one for a quick pick, or several for a list. Quick buttons offer 1, 5, 6, and 10.
- Toggle "unique" if no number may repeat within the draw (for example, lottery lines or drawing names). Leave it off if repeats are fine, like rolling several dice.
- Optionally sort the results in ascending order to make a multi-number draw easier to read.
- Press Generate. The result appears instantly. Changing a setting clears the old result, and every press gives a fresh, independent draw. The first draw happens as soon as the page loads, using 1 to 100.
Who this tool is for
- Teachers and presenters cold-calling a student number or picking a group at random.
- Giveaway and raffle hosts drawing a winner from a numbered list of entrants.
- Gamers and tabletop players who need dice, a coin flip, or a random card index without physical props.
- Researchers and analysts pulling a random sample of rows, IDs, or participants to reduce bias.
- Anyone making a decision, such as assigning chores, picking who goes first, or settling a friendly tie.
Worked example 1: roll two dice
Set the minimum to 1, the maximum to 6, the count to 2, and leave "unique" off (because two real dice can both show the same face). Press Generate and you might get 4 and 4, or 2 and 5. Each die is independent, so doubles are perfectly possible: on average they come up 1 roll in 6 (6 of the 36 combinations).
Worked example 2: a lottery line
To mimic a 6-from-49 lottery, set the range to 1-49, the count to 6, and turn "unique" on so no ball repeats. A draw might return 3, 11, 17, 28, 36, 44. Tap "Draw order" to switch to "Sorted" and the same six numbers read smallest first, like a published result. Because the numbers are unique and uniform, every combination is equally likely, so there is no "smart" set of numbers.
Worked example 3: pick a random winner
Suppose 250 people entered a giveaway and you numbered the entries 1 to 250. Set the minimum to 1, the maximum to 250, and the count to 1. Press Generate and the tool returns a single number, say 137, identifying the winning entry. To draw three winners with no one winning twice, set the count to 3 and turn on "unique."
Quick reference: common settings
Here are the settings for the most common everyday uses:
| Use case | Range | Count | Unique |
|---|---|---|---|
| Coin flip (1 = heads) | 1 to 2 | 1 | n/a |
| Single die | 1 to 6 | 1 | n/a |
| Two dice | 1 to 6 | 2 | Off |
| Percentage (0-100) | 0 to 100 | 1 | n/a |
| Lottery (6 of 49) | 1 to 49 | 6 | On |
| Pick a winner (200 entries) | 1 to 200 | 1 | n/a |
Key terms explained
- Range: the span between your minimum and maximum, including both endpoints. A range of 1-100 contains 100 possible values.
- Uniform distribution: every value in the range is equally likely. This tool always uses a uniform distribution; it does not weight any number more heavily than another.
- Pseudo-random (PRNG): a number sequence produced by an algorithm that looks random and passes statistical tests, but is generated deterministically from an internal starting point (seed). JavaScript's Math.random() is one.
- Cryptographically secure (CSPRNG): a stronger generator designed so that outputs cannot be predicted even by someone who has seen previous values. The browser's crypto.getRandomValues(), which this tool uses, is one.
- Modulo bias: the small unfairness you get when random bits are squeezed into a range with a remainder (mod) operation and the number of possible bit patterns is not a multiple of the range size. The discard method used here removes it.
- With vs. without replacement: "without replacement" means each pick is removed from the pool so it cannot recur, which is what the "unique" toggle does. "With replacement" (unique off) lets values repeat.
Math.random() vs. crypto.getRandomValues()
Browsers offer two sources of randomness. Math.random() is a fast pseudo-random generator meant for everyday scripting; it is not designed to resist prediction, and code that scales it to a range with rounding can be very slightly uneven. crypto.getRandomValues() is the browser's cryptographically secure generator: the W3C Web Cryptography specification says it "generates cryptographically strong random values" and asks browsers to build it on a well-established cryptographic generator seeded with high-quality entropy. This tool uses the second one and converts its bits with the NIST discard method, so each number in your range has exactly the same chance and earlier results reveal nothing about the next one.
A secure source does not turn a web page into a security product, though. The numbers appear on your screen, browser extensions can read the page, and nothing here is audited or certified. Use the generator for games, raffles, sampling, classroom picks and your own lottery lines, and use a password manager for passwords, tokens and encryption keys.
Tips for getting the result you want
- Need decimals? Generate a whole number over a larger range, then divide. For a value between 0.00 and 1.00, draw 0-100 and divide by 100.
- Picking from a named list? Number your items 1 to N, draw a number, and match it back to the name.
- Want every item exactly once (a shuffle)? Set the range to cover your whole list, the count to the list length, and turn "unique" on. The result is a random ordering.
- Drawing names without repeats? Always turn on "unique" so the same person cannot be picked twice.
- Re-rolls are fine. If you do not like a draw, pressing Generate again is itself random; it does not bias the next result.
Related concepts and tools
A random number generator is the engine behind dice rollers, coin flippers, name pickers, password generators, raffle drawers, and statistical sampling tools; they all dress up the same uniform draw for a specific job. If you want to reason about the odds of a particular outcome rather than just draw one, the Probability Calculator works out the likelihood, and the Permutation & Combination Calculator counts how many distinct draws or orderings are even possible. Once you have a list of generated numbers, the Average Calculator and Standard Deviation Calculator summarize and spread-check them, and the Z-Score Calculator tells you how unusual any single value is.
Random sampling without bias
One of the most valuable jobs a random number generator does is pull an unbiased sample. Suppose you have a list of 5,000 customer records and you want to audit 50 of them. If you eyeball the list and "pick some," you may unconsciously favor familiar names, round-numbered rows, or entries near the top, and your audit is skewed before it starts. Instead, number the rows 1 to 5,000, set the range accordingly, set the count to 50, turn "unique" on (you do not want to audit the same record twice), and let the tool draw the sample. This is called simple random sampling, and it gives every record an equal chance of selection, which is the foundation of any defensible statistical inference. The same method works for quality-control spot checks, A/B test group assignment, jury-style selection, and survey respondent picking. When the sample is genuinely random, you can use the Standard Deviation Calculator to estimate how confident you can be that the sample reflects the whole group.
Simulating dice, cards, and games of chance
Tabletop and board games lean heavily on randomness, and a generator can replace almost any physical randomizer. A standard six-sided die is a 1-6 draw; a twenty-sided die (d20) used in role-playing games is a 1-20 draw; percentile dice are 1-100. Need to draw a card from a 52-card deck? Number the cards 1 to 52, draw one, and map the result back (1-13 hearts, 14-26 spades, and so on). To deal a five-card hand, set the count to 5 with "unique" on so no card appears twice. Because each draw is independent and uniform, the long-run behavior matches a fair die, a fair shuffle or a fair coin. If you want to know how likely a particular roll or hand actually is before you draw it, pair this generator with the Probability Calculator to compute the odds.
Probability of each two-dice sum (two 1-6 draws)
Rolling two dice with "unique" off is two independent 1-6 draws, and the 36 equally likely combinations do not spread evenly across the totals: 7 is the most common sum, 2 and 12 the rarest. These probabilities are exact.
| Sum of two dice | Combinations (of 36) | Probability | Odds |
|---|---|---|---|
| 2 | 1 | 2.78% | 1 in 36 |
| 3 | 2 | 5.56% | 1 in 18 |
| 4 | 3 | 8.33% | 1 in 12 |
| 5 | 4 | 11.11% | 1 in 9 |
| 6 | 5 | 13.89% | 1 in 7.2 |
| 7 | 6 | 16.67% | 1 in 6 |
| 8 | 5 | 13.89% | 1 in 7.2 |
| 9 | 4 | 11.11% | 1 in 9 |
| 10 | 3 | 8.33% | 1 in 12 |
| 11 | 2 | 5.56% | 1 in 18 |
| 12 | 1 | 2.78% | 1 in 36 |
Lottery picks and the math behind them
Plenty of people use a random number generator to choose lottery lines, and the tool is perfectly suited to it: set the range to the game's number pool (for example 1-49 or 1-69), set the count to how many balls are drawn, and turn "unique" on. What the generator cannot do is improve your odds, because in a fair lottery every valid combination is equally likely: a "random" line such as 4, 8, 15, 16, 23, 42 has exactly the same chance as 1, 2, 3, 4, 5, 6. What a random line can change is how many people you might share a prize with: if many players pick the same pattern, such as dates from 1 to 31 or a run like 1, 2, 3, 4, 5, 6, a win on that pattern is split more ways, and a random line does not aim at any pattern on purpose. To see how steep the odds truly are, the Permutation & Combination Calculator shows how many possible combinations exist, and if you ever do win, the Lottery Tax Calculator estimates what you would actually take home after federal and state tax.
How many combinations are in a "pick k of N" draw?
When you draw k unique numbers from a pool of N, the number of distinct combinations is C(N, k) = N! / (k! (N-k)!). Assuming one line and that every combination is equally likely, matching them all carries exactly those odds.
| Draw (pick k of N) | Distinct combinations | Odds of matching all |
|---|---|---|
| 3 of 10 | 120 | 1 in 120 |
| 5 of 39 | 575,757 | 1 in 575,757 |
| 6 of 42 | 5,245,786 | 1 in 5,245,786 |
| 6 of 49 | 13,983,816 | 1 in 13,983,816 |
| 5 of 69 | 11,238,513 | 1 in 11,238,513 |
| 5 of 70 | 12,103,014 | 1 in 12,103,014 |
Picking names and assigning groups fairly
Teachers, managers, and event hosts constantly need to choose people at random: cold-calling a student, drawing a prize winner, deciding turn order, or splitting a class into project teams. The reliable method is always the same: build a numbered list of everyone, then draw against it. To pick one person, draw a single number. To pick several winners with nobody winning twice, raise the count and turn "unique" on. To split 24 people into 4 teams, generate a unique random ordering of 1-24 (count 24, unique on, sort off) and deal them out in blocks of six: the first six numbers are team one, the next six team two, and so on. Doing it this way answers any accusation of favoritism, because the method is transparent: every name had the same chance and none carried extra weight.
Generating decimals, percentages, and ranges with steps
This tool draws whole integers, but a little arithmetic extends it to almost any numeric format you need. For a random percentage, draw 0-100. For a value between 0.00 and 1.00, draw 0-100 and divide by 100; for three decimal places, draw 0-1000 and divide by 1,000. To pick a random price like $0.00-$50.00, draw 0-5000 (cents) and divide by 100. If you need values that fall only on a fixed step, say multiples of 5 between 0 and 100, draw 0-20 and multiply by 5. The principle is to map your target range onto a clean integer range, draw, then scale or shift the result. This keeps every outcome uniform, because multiplying or dividing a uniform draw by a constant preserves the equal-chance property. When you later want to describe the spread of those scaled values, the Average Calculator gives the center and the Standard Deviation Calculator gives the spread.
How seeds and reproducibility work
Every algorithmic generator starts from an internal seed, a starting value that determines the sequence of "random" numbers that follow. The browser seeds crypto.getRandomValues() itself from high-quality entropy, and no web page can set or read that seed. That is why this tool gives a fresh, unpredictable result on every press and why you cannot reproduce a past draw exactly. It is the right behavior for raffles, games, and picks, where you want each draw to be independent. In programming and scientific simulation, by contrast, people often do set a fixed seed on purpose, so that a colleague running the same code gets the identical "random" sequence and can verify the result. If reproducibility matters for your work (repeatable experiments, debugging a simulation, or sharing an exact sample), use a seeded generator in a spreadsheet or programming language, and keep a copy of any draw from this page that you need to document.
Limitations and assumptions
- It produces whole integers only; decimal bounds are rounded inward before the draw.
- It uses a uniform distribution; there is no way to weight some numbers more than others.
- The random source is cryptographically secure, but the page is not certified for official lotteries, sweepstakes or regulated gaming, and it is not a password manager.
- Draws cannot be repeated: there is no seed you can set or save.
- Draws are capped at 10,000 numbers to keep the page responsive.
- You cannot request more unique numbers than the range contains.
Sources
- NIST, SP 800-90A Rev. 1, Recommendation for Random Number Generation Using Deterministic Random Bit Generators (June 2015), Appendix A.5.1 "The Simple Discard Method".
- W3C, Web Cryptography API (W3C Recommendation, January 26, 2017), section on the getRandomValues method.
- Kubovy, M., and Psotka, J. (1976). The predominance of seven and the apparent spontaneity of numerical choices. Journal of Experimental Psychology: Human Perception and Performance, 2(2), 291-294.
โ ๏ธ Common mistakes & edge cases
Asking for more unique numbers than exist
You cannot draw 10 unique numbers from a range of 1-6, because only six distinct values exist. The tool flags this; lower the count or widen the range.
Expecting "no repeats" with unique off
With "unique" turned off, every pick is independent, so repeats are normal and expected, especially over a small range. Turn "unique" on whenever each number must be different.
Treating it as an official drawing or a password tool
The numbers come from a cryptographically secure source, but this is a general-purpose web page. It is not certified for official lotteries, sweepstakes or regulated gaming draws, and it shows results on screen. For passwords, tokens or encryption keys, use a password manager or the key tools of your operating system.
Forgetting the range is inclusive
A range of 1-100 can return both 1 and 100. If you want results from 1 to 99, set the maximum to 99. Decimal bounds round inward, so 2.5-9.5 becomes 3-9.
❓ Frequently asked questions
How does this random number generator work?
You set a minimum and a maximum, choose how many numbers you want, and decide whether they must be unique. The tool then draws whole numbers in that inclusive range from your browser's cryptographically secure generator, crypto.getRandomValues(), and converts the random bits to your range with the discard method from NIST SP 800-90A, which has no bias. Each integer in the range has exactly the same chance of being picked, so a 1 to 6 generator behaves like a fair die and a 1 to 49 generator with unique on behaves like a lottery draw.
Are the numbers inclusive of the minimum and maximum?
Yes. The range is inclusive on both ends, so a range of 1 to 100 can return 1, 100, or anything in between. If you type decimal bounds, the generator rounds the minimum up and the maximum down to whole numbers, tells you it did so, and then picks uniformly across every integer from the low value to the high value.
What does the 'unique' option do?
When 'unique' is on, no number is repeated within a single draw, which is what you want for picking lottery numbers, drawing names, or shuffling a list. When it is off, the same number can appear more than once, like rolling several independent dice. You cannot request more unique numbers than the range contains; for example, you cannot draw 10 unique numbers from a range of only 6 values, and the tool tells you so.
Is this generator truly random?
The numbers come from the browser's cryptographically secure generator. The W3C Web Cryptography specification says crypto.getRandomValues() generates cryptographically strong random values and tells browsers to use a well-established cryptographic generator seeded with high-quality entropy. That makes the results unpredictable for practical purposes. Strictly speaking it is still a deterministic algorithm rather than a physical process like radioactive decay, and the page is a general tool: it is not certified for official lotteries, sweepstakes or regulated gaming.
Can I use this to roll dice or flip a coin?
Yes. For a single six-sided die, set the range to 1-6 and count to 1. For two dice, set count to 2 with unique turned off. For a coin flip, use a range of 1-2 (1 = heads, 2 = tails) or 0-1. The 1, 5, 6 and 10 quick buttons make common counts fast to set.
How many numbers can I generate at once?
You can request up to 10,000 numbers in a single draw, from a range as wide as minus one quadrillion to plus one quadrillion (1,000,000,000,000,000). Those limits keep the page responsive and every number exact. If you need a very large dataset for analysis or simulation, a spreadsheet or programming language is a better tool, but for picks, samples and lists this is more than enough.
Why do I sometimes get the same number twice?
With the 'unique' option off, every draw is independent, so repeats are completely normal and in fact expected. If you draw 10 numbers from 1 to 6, you always get duplicates because there are only six possible values. Even with a wider range repeats come up sooner than most people expect: for 10 draws from 1 to 100 the chance of at least one repeat is about 37%. Turn on 'unique' if you need every number in the draw to be different.
Can I pick negative numbers or a range that crosses zero?
Yes. You can enter negative values for the minimum, the maximum, or both, for example -50 to 50, or -10 to -1. The generator picks uniformly across every integer in the span you define, including zero and negative numbers. If you type the larger value as the minimum, the tool swaps them and says so.
Does it generate decimals, or only whole numbers?
This tool generates whole integers only. If you enter decimal bounds, the minimum is rounded up and the maximum is rounded down to the nearest integers before the draw, and a note under the result says so. For random decimals or percentages, multiply or divide the result yourself: for example, divide a 0 to 100 result by 100 to get two-decimal values between 0.00 and 1.00.
Is the result saved or sent anywhere?
No. Everything runs locally in your browser. Nothing you enter and no number you generate is stored, logged, or transmitted to a server, so each draw is private to your device. Refreshing the page resets the generator to its defaults.
What are the odds of rolling a 7 with two dice?
A 7 is the single most likely total from two dice: 6 of the 36 equally likely combinations (1+6, 2+5, 3+4, 4+3, 5+2, 6+1) add to 7, which is a probability of 16.67%, or odds of 1 in 6. To mimic it here, set the range to 1-6, the count to 2, and leave 'unique' off, then add the two draws. By contrast, a 2 or a 12 comes up only 1 time in 36 (2.78%).
How many possible combinations are in a 6-of-49 lottery draw?
There are exactly 13,983,816 distinct combinations when you pick 6 unique numbers from a pool of 49, so a single line has a 1-in-13,983,816 chance of matching all six. The figure comes from the combination formula C(49, 6) = 49! / (6! x 43!). Every valid combination is equally likely, so no set of numbers is 'smarter' than any other.
๐ก Good to know
Humans are bad at being random
When people are asked to "pick a random number," their choices are not spread evenly. Psychologists Michael Kubovy and Joseph Psotka named a 1976 study "The predominance of seven and the apparent spontaneity of numerical choices" after how often people pick 7. A generator removes that kind of bias, which matters for fair draws and unbiased samples.
No number is ever "due"
Each draw is independent. If 7 has not appeared in your last ten rolls, it is not any more likely to come up next; believing otherwise is the gambler's fallacy. Streaks and gaps are a normal feature of true randomness.
Everything stays on your device
The generator runs entirely in your browser. Your inputs and the numbers you generate are never sent to a server, stored, or logged; each draw is private and disappears when you refresh.
Related Calculators
Probability Calculator
Calculate the probability of events
Permutation & Combination Calculator
Calculate nPr and nCr
Lottery Tax Calculator
Estimate taxes on lottery winnings (lump sum vs annuity)
Average Calculator
Calculate the mean, median and mode of numbers
Standard Deviation Calculator
Calculate standard deviation, variance and mean
Z-Score Calculator
Calculate the z-score of a value