Random number generator
Set a range – say 1 to 100 or 0 to 100 – choose how many, done. Without repeats every number appears at most once, just like drawing balls from a lottery drum.
How it is calculated
Every whole number between "From" and "To" (both included) is equally likely. From 1 to 100 there are 100 possible numbers, so each has a 1% chance; from 0 to 100 there are 101 numbers. The random values come from crypto.getRandomValues(), your browser's cryptographically secure generator. When scaling to your range, unsuitable raw values are discarded so that no number is favoured.
With or without repeats?
- No repeats is like drawing balls from a lottery drum: each ball drawn is gone. Right for lottery numbers, raffle tickets, starting orders or samples.
- With repeats is like rolling a die several times: any number can come up again. Right for simulations or when numbers should be independent.
Without repeats the generator uses Floyd's algorithm: it picks every possible subset with exactly equal probability, even for huge ranges like 1 to 1 billion, without holding every number in memory. The order is then shuffled with Fisher-Yates.
Example: 5 numbers from 1–100 without repeats
Enter From 1, To 100, count 5, "No repeats" on. Each single number has a 5% chance of being in the draw (5 of 100). One specific set of five comes up with odds of 1 in (100 choose 5) = 1 in 75,287,520 – the tool shows both values right below the fields.
With repeats allowed, duplicates are more common than most people expect: drawing 10 numbers from 1–100 gives at least one duplicate 37.2% of the time (1 − 100·99·…·91 ÷ 10010). That is why lottery numbers must be drawn without replacement – the presets do this automatically.
Special cases
- 1 or 2 / 1–3 / 1–6: just set the range; each number gets 1/2, 1/3 or 1/6. For 1–6 the dice roller is more visual, for two options the coin flip.
- Including zero: 0 to 100 contains 101 numbers, not 100.
- Decimals: the generator draws whole numbers only. For two decimal places, draw e.g. 0 to 1,000 and divide by 100 (0.00 to 10.00).
Lottery presets and their real odds
Each preset fills in a real lottery's main numbers. If k different numbers are drawn from N and order does not matter, there are "N choose k" combinations – counted exactly, not estimated:
| Lottery | Main numbers | Extra ball | Main-number combinations |
|---|---|---|---|
| Powerball (US) | 5 from 1–69 | 1 Powerball from 1–26 | 11,238,513 |
| Mega Millions (US) | 5 from 1–70 | 1 Mega Ball from 1–24 | 12,103,014 |
| Lotto (UK) | 6 from 1–59 | – | 45,057,474 |
| EuroMillions | 5 from 1–50 | 2 Lucky Stars from 1–12 | 2,118,760 |
Multiply in the extra ball and the published jackpot odds come out exactly: Powerball is 11,238,513 × 26 = 1 in 292,201,338 and Mega Millions is 12,103,014 × 24 = 1 in 290,472,336 – the Mega Ball pool was cut from 25 to 24 numbers in the April 2025 rule change, which is why the odds differ slightly from Powerball's. EuroMillions is 2,118,760 × 66 = 1 in 139,838,160. UK Lotto has no extra ball in its jackpot combination, so 1 in 45,057,474 is already the full odds. Sources: powerball.com, megamillions.com, national-lottery.co.uk, euro-millions.com.
A preset only draws the main numbers. Draw the extra ball afterwards with a second click: Powerball from 1 to 26, Mega Millions (Mega Ball) from 1 to 24, EuroMillions two Lucky Stars from 1 to 12 without repeats. UK Lotto needs no extra draw.
True randomness, not just software randomness
Many simple generators use Math.random(), a pseudo-random algorithm: the sequence is computed and predictable once you know its internal state, and it is not fit for cryptographic use. This tool instead draws its raw values from crypto.getRandomValues(), a cryptographically secure random number generator (CSPRNG) that the operating system seeds from real entropy sources such as hardware noise. Each draw is independent of the last: drawing with repeats and getting the same number twice is not a bug, it is exactly what true independence looks like – just like rolling a die more than once.
For single numbers at the game table the dice roller is more visual; for names instead of numbers use the random name picker.
Frequently asked questions
Is this true randomness or a pseudo-random generator?
True crypto-grade randomness: the raw values come from the Web Crypto API (a CSPRNG), not the simple pseudo-randomness (Math.random()) that many other generators use. That is enough for games, raffles and most other purposes; for extremely high-security uses such as cryptographic key generation, use a dedicated crypto library instead.
Can I use negative numbers?
Yes, e.g. from −10 to 10. Whole numbers up to ±1 quadrillion are allowed.
How do I generate a number between 1 and 100, or 0 and 100?
Click the "1–100" preset for a range of 1 to 100. For 0 to 100 instead, set "From" to 0 and "To" to 100 yourself – the range then includes zero and has 101 possible numbers.
How do I fill in Powerball, Mega Millions, UK Lotto or EuroMillions numbers?
Click the matching preset – it sets the range, count, no repeats and sorted, then draws the main numbers immediately. Powerball, Mega Millions and EuroMillions each need one more draw for the extra ball, done separately with the ranges given above; UK Lotto needs no extra ball.
Why can the same number appear twice with repeats allowed?
Because each draw is independent, just like rolling a die several times. Two identical numbers in a row are not a bug – with enough draws they are actually expected. To make every number appear at most once, turn on "No repeats".
How does a random number generator work?
It takes raw values from a source of randomness – here the browser's cryptographic generator, seeded by the operating system from sources such as hardware noise – and maps them evenly onto your range. Raw values that would favour some numbers are discarded and redrawn, so every number from "From" to "To" has exactly the same chance.
How do I generate a random number in Excel?
Use =RANDBETWEEN(1,100) for a whole number from 1 to 100; =RAND() returns a decimal between 0 and 1. Both recalculate whenever the sheet changes. Excel has no single formula for several numbers without repeats – this generator is simpler for that.
Can I share my settings?
Yes. Range, count and options are stored in the address bar automatically. Anyone opening the link gets the same settings – the numbers themselves are drawn fresh each time.
Sources and legal basis
- W3C Recommendation: W3C Web Cryptography API – getRandomValues()
- MDN Web Docs – Crypto.getRandomValues()
As of:
Related tools
- Dice Roller – Roll a Dice Online, d4 to d20, up to 10 Dice
Online dice roller: roll 1–10 dice with 4, 6, 8, 10, 12 or 20 sides, d6 with dots, total, roll history and exact odds. Fair cryptographic randomness.
- Random Name Picker – draw winners, shuffle, make teams
Random name picker, list randomizer and team generator in one: draw winners, shuffle for Secret Santa, or split fair teams. Free, no sign-up.
- Random Number Wheel – Spin 1–10, 1–100 or Any Range
Random number wheel: spin 1–10, or type 1–20, 1–50 or 1–100. Every number equally likely, optional no-repeat mode. Free for class, bingo and games.
- Flip a Coin – Heads or Tails, 1 to 100 Coins at Once
Flip a coin online: heads or tails, 1 to 100 coins per toss, live stats with share and longest streak. Fair cryptographic randomness, no sign-up.
- Random Color Wheel – Spin to Pick a Random Color
Random color wheel: spin for one of 10 basic colors (10% each) or add your own. For kids’ games, drawing prompts and DIY Twister. Free, no sign-up.
- Random Country Wheel – Spin to Pick a Country
Spin a wheel with 40 countries from every continent for a random pick: geography quiz, travel inspiration or a world-themed game night. Free.