Random Number Generator

Need a number between 1 and 10, a raffle winner, six lottery-style picks or a random sample for an experiment? This generator draws numbers from any range you choose — whole or decimal, with or without repeats, in any order — and shows the sum, average and extremes. Unlike many online tools it does not use the weak, predictable Math.random(): it asks your browser’s cryptographic random generator for bits and uses rejection sampling, so every whole number in the range is exactly as likely as every other. Nothing is sent anywhere, and results are never stored.

How to use the random number generator

  1. Enter the minimum and maximum. Both ends are included for whole numbers.
  2. Choose how many numbers you need and whether repeats are allowed. For raffles and sampling, pick “all numbers different”.
  3. Set decimal places above 0 for fractional numbers, and choose an order if you want the results sorted.
  4. Press Generate for a fresh set — results change every time.

Formula

For whole numbers the generator draws uniformly from min, min + 1, …, max (that is max − min + 1 equally likely values). Raw random 32-bit values are discarded when they would make some numbers slightly more likely than others (rejection sampling), which removes the “modulo bias” that affects naive generators. For decimals, value = min + u × (max − min) where u is a uniform number between 0 and 1, rounded to the places you chose.

Worked examples

Six different numbers from 1 to 49

Set the range 1–49, count 6 and “all numbers different”, sorted smallest first — the shape of a lottery draw. Each number is equally likely; the generator cannot improve your odds, only pick for you.

A raffle winner

If tickets are numbered 1 to 250, set min 1, max 250 and count 1. For a first, second and third prize with no repeats, set count 3 and “all numbers different”.

A random decimal

Range 0 to 1 with 4 decimal places gives numbers such as 0.7312, useful for quick probability experiments: a result below 0.25 happens about a quarter of the time.

Common mistakes to avoid

  • Assuming a short run “should” look even. Real random sequences clump: three 7s in a row in 30 draws is not a sign of a broken generator.
  • Forgetting that “unique” needs a range at least as big as the count — 10 different numbers cannot come from 1–5.
  • Using a pseudo-random generator for security or high-stakes draws. Use a cryptographic one, as this tool does, and let witnesses watch a public draw.
  • Treating random numbers as lucky or predictable. Past results do not influence the next one (the gambler’s fallacy).
  • Mixing up inclusive and exclusive ranges — here both the minimum and the maximum can appear.

Frequently asked questions

Is this random number generator truly random?

It uses your browser’s cryptographically secure source (crypto.getRandomValues), which draws on operating-system entropy. It is statistically uniform and unpredictable for practical purposes, far better than Math.random().

Can the same number appear twice?

Yes, unless you choose “all numbers different”. With repeats allowed, each draw is independent.

Does it include the minimum and maximum?

Yes. For whole numbers both ends can appear.

Can I use it for a giveaway or raffle?

Yes for casual draws. For legal or high-value draws, follow your local rules and keep an auditable record, such as a screen recording.

Does it store my numbers?

No. Everything happens in your browser and nothing is saved or sent.

How many numbers can I generate at once?

Up to 1,000. The first 40 are shown in full, with the sum and average for all of them.

Sources and further reading

Reviewed September 26, 2026 by the SolveCalcPro editorial team. Found a mistake? Tell us; see our editorial policy.