Generated values
Each generated number, shown for a quick visual comparison.
Home / Math Calculators / Random Number Generator
Math & Statistics
Generate one or many random numbers in any range. Choose integers or decimals, and allow or forbid duplicate values.
Your random numbers
Generated values
Each generated number, shown for a quick visual comparison.
The generator uses your browser's built-in pseudo-random function to pick numbers uniformly across the range you set, inclusive of both ends. With "unique values" on, it draws without replacement so no number repeats.
Every whole number in the range has the same chance, 1 ÷ (max − min + 1). Picking from 1 to 100 gives each number a 1% chance, and drawing 6 unique numbers from 1 to 49 can produce 13,983,816 different combinations, the same odds as a classic 6/49 lottery.
For a raffle, number the tickets, generate one value per prize with repeats turned off, and record the results before you reveal them. The generator uses your browser's standard random function, which is fine for games, classroom picks and giveaways; for security keys or regulated lotteries use a cryptographically secure source such as the password generator, which uses the Web Crypto API.
| Use | Settings |
|---|---|
| Roll a die | Min 1, max 6, one number |
| Flip a coin | Min 1, max 2 (1 = heads, 2 = tails) |
| Pick a raffle winner | Min 1, max = number of tickets, unique values on |
| Choose 3 people from a class of 30 | Min 1, max 30, count 3, unique values on |
| Random percentage | Min 0, max 100, decimals on |
When order doesn't matter and numbers can't repeat, the number of possible draws is n! ÷ (k! × (n − k)!), written "n choose k".
| Draw | Combinations | Odds of one exact set |
|---|---|---|
| 3 from 10 | 120 | 1 in 120 |
| 5 from 52 (a poker hand) | 2,598,960 | 1 in 2,598,960 |
| 5 from 69 | 11,238,513 | 1 in 11,238,513 |
| 6 from 49 | 13,983,816 | 1 in 13,983,816 |
To put a list into random order, such as a presentation order, a tournament seeding or a playlist, set the minimum to 1, the maximum to the number of items, How many to the same number, and turn on unique values. The result is a random permutation: read it as "item 7 goes first, item 2 second" and so on. Every possible order is equally likely.
To split 24 people into 4 teams of 6, number them 1 to 24 and generate all 24 unique values. The first six numbers form Team A, the next six Team B, and so on. This is fairer than letting captains pick, and quicker than drawing names from a hat.
A simple random sample gives every member of a group the same chance of being chosen. That's the basis of most statistics. To survey 50 customers out of a list of 1,200, sort the list in any fixed order, generate 50 unique numbers from 1 to 1,200, and contact the customers in those rows. Auditors use the same method to choose invoices to check, and teachers use it to pick work to moderate. Write down the numbers before you look at the list, so nobody can say the sample was chosen by hand.
One die gives a flat distribution: each face from 1 to 6 has a 1 in 6 chance. Adding dice changes that. Rolling two dice and adding them is not the same as picking a number from 2 to 12:
| Result | Two dice (2d6) added | Single pick from 2–12 |
|---|---|---|
| 2 or 12 | 2.8% each (1 in 36) | 9.1% each (1 in 11) |
| 4 or 10 | 8.3% each (3 in 36) | 9.1% each |
| 7 | 16.7% (6 in 36) | 9.1% |
To simulate a board game correctly, generate two numbers from 1 to 6 with duplicates allowed and add them. For tabletop role-playing dice, set the maximum to 4, 8, 10, 12 or 20 for a d4, d8, d10, d12 or d20.
With duplicates allowed, repeats turn up sooner than most people expect. Drawing 10 numbers from 1 to 100 gives a 37% chance that at least one number appears twice. Drawing 30 gives a 99% chance. The general rule is 1 − n! ÷ ((n − k)! × nᵏ) for k draws from n values. It's the same maths as the birthday problem above. If a repeat would spoil your use, such as giving one person two prizes, turn on unique values.
Browsers' Math.random() uses a fast pseudo-random algorithm that is statistically uniform but predictable in principle. crypto.getRandomValues() draws from the operating system's secure entropy source and is designed to be unpredictable, which is why it is used for passwords and encryption keys.
They are pseudo-random from your browser, plenty random for games, raffles, and sampling, but not for cryptography.
Yes, enable "unique values" and every result is different, provided the range is large enough.
One divided by the number of values in the range. From 1 to 50, each number has a 1 in 50 (2%) chance on a single draw.
13,983,816 combinations when order does not matter and numbers do not repeat.
Number every entry, set the range from 1 to the total number of entries, turn on unique values, and generate one number per prize. Record or screenshot the result before announcing it.
Set the range from 1 to the number of items, generate that many numbers with unique values on, and use the results as the new order.
The number of ways to choose k items from n when order doesn't matter: n! ÷ (k! × (n − k)!). For 6 from 49 that is 13,983,816.