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.

Ready – press "Generate numbers" or pick a preset.

1 to 1,000

Result

Possible numbers in range
100
Chance of one specific number
1% (1 in 100) per draw

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?

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

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:

LotteryMain numbersExtra ballMain-number combinations
Powerball (US)5 from 1–691 Powerball from 1–2611,238,513
Mega Millions (US)5 from 1–701 Mega Ball from 1–2412,103,014
Lotto (UK)6 from 1–59–45,057,474
EuroMillions5 from 1–502 Lucky Stars from 1–122,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

As of:

Embed on your website

Free, no sign-up: copy the code and paste it into your page (e.g. an HTML block). Feel free to adjust the size and the link.

Open preview

Related tools