Random number generator
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.
Source: W3C Recommendation, W3C Web Cryptography API – getRandomValues(). Updated: .
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: set “Decimal places” to 1–6 and the generator draws decimal numbers: 0 to 10 with 2 places gives 0.00 to 10.00 (1,001 equally likely values).
All numbers in random order (1–100 shuffled)
To put every number from 1 to 100 in random order – for seating, raffle tickets or bingo calling – set From 1, To 100, count 100, “No repeats” on and “Sort” off. Each number then appears exactly once, shuffled. Up to 1,000 numbers can be drawn at once. To split people into groups instead, use the random team generator; for a visual draw, spin the wheel.
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.
How do I get all numbers from 1 to 100 in random order with no repeats?
Set From 1, To 100, count 100, turn on “No repeats” and leave “Sort” off. Every number appears exactly once in shuffled order.
Sources and legal basis
- W3C Recommendation: W3C Web Cryptography API – getRandomValues()
- MDN Web Docs – Crypto.getRandomValues()
As of: · Editorial policy
Related tools
- Dice roller: roll d6, d20 and more onlineDice roller: roll d4 to d100 or type dice notation like 3d6+2 or 2d20kh1. Several sets at once, advantage, roll history, exact odds and a shareable link.
- Random name picker and list randomizerRandom name picker and list randomizer: draw one or more winners with no repeats, shuffle the order or split a list into groups. Free, no sign-up.
- Random number generator wheel: 1 to 10 or any rangeRandom 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?Flip a coin online: heads or tails, 1 to 1,000 flips per toss, your own labels for both sides, live stats and streaks. Cryptographic randomness, no sign-up.
- Play Solitaire OnlineFree Klondike solitaire in your browser: draw 1 or 3, unlimited undo, hints and a winnable daily deal. Share your time – the link deals the same cards.
- Bingo caller online with voiceBingo caller online: draws the balls 1–75 or 1–90 with no repeats, reads each number aloud and marks it on the board. Auto mode, full screen, no sign-up.
- Point buy calculatorPoint buy calculator for D&D 5e (27 points, scores 8–15) and Pathfinder (10–25 points): cost of each ability score, points left, final scores and modifiers.
- Random US state generator: spin the wheelSpin a wheel with all 50 US states for a random pick: geography quiz, road-trip idea or classroom game. Includes a capitals table, free, no sign-up.
- Workout wheel: spin your trainingWorkout wheel with 12 no-equipment exercises like push-ups, plank and squats, 8.33% chance each. With how-tos, beginner options and a routine.