Home / Calculators / Random Number Generator

Random Number Generator

Generate fair random numbers in any range — single draws, lists, dice rolls and coin flips — using your browser's cryptographic random source, not a predictable shuffle.

—

Uses cryptographic randomness (crypto.getRandomValues) with rejection sampling — every outcome equally likely.

Overview

Picking something “at random” is easy to say and surprisingly hard to do fairly. Human picks cluster: we avoid edges, repeat favourites and unconsciously pattern our choices. This generator removes the human from the draw, using your browser's cryptographic random source — the same machinery that secures web connections — with rejection sampling so every possible outcome is exactly equally likely.

Three modes cover the classics: numbers in any range (with unique-only and sorted options), dice with any side count, and coin flips. Whether you are drawing raffle winners, assigning teams or settling an argument, the result is a fair draw you can defend.

What makes randomness “fair”?

Fairness means uniformity: each possible outcome must have exactly the same probability. The naive way programmers generate random numbers — take a big random value modulo the range size — is subtly biased, because the big value's range rarely divides evenly. If the remainder is discarded and the draw repeated (rejection sampling), the bias disappears completely. This page does exactly that.

The random source matters too. Ordinary Math.random() is a pseudo-random generator: deterministic, seeded, and predictable if you know its state — fine for games, wrong for anything adversarial. This tool uses crypto.getRandomValues(), the operating system's entropy pool, which is unpredictable by design.

Features

Benefits

Who can use it

Teachers picking students or splitting classes, organisers drawing raffle winners, game masters rolling unusual dice, friends settling “who goes first”, developers needing quick test data, and researchers randomising trial orders. Anyone who needs a draw they can describe as fair without crossing their fingers.

How to use

  1. Pick Numbers, Dice or Coin at the top.
  2. For numbers: set the range and how many you want; tick unique-only or sort if needed.
  3. For dice: set how many dice and how many sides each has.
  4. Press Generate — press again for a fresh draw any time.
  5. Use Copy results to take the draw elsewhere.

Frequently asked questions

Is this random enough for a real raffle?

Yes. It uses the operating system's cryptographic entropy pool with rejection sampling, which is the standard for fairness — far beyond what a raffle needs. What it cannot do is provide witnesses: for high-stakes draws, run it on a screen everyone can see, or use a supervised draw service.

Why not just use Math.random()?

Because Math.random() is deterministic: seeded the same way, it replays the same sequence. That is fine for shuffling a playlist but wrong when fairness must be defensible. The cryptographic source draws from real system entropy — keystroke timing, hardware noise — and cannot be replayed.

What does “unique only” do if the range is too small?

It tells you plainly instead of hanging. Asking for 10 unique numbers from 1–5 is impossible, so the tool reports that the range is too small rather than looping forever or silently repeating.

Can I generate decimal numbers?

This tool draws integers only, which covers dice, draws, lotteries and most everyday needs. For decimals, generate integers and divide — for example, 1–1000 divided by 1000 gives three-decimal values between 0.001 and 1.

Are my draws stored anywhere?

No. Each draw exists in the page's memory until the next one replaces it. Nothing is uploaded, logged or remembered.

Conclusion

Fairness is a method, not a feeling. Cryptographic entropy plus rejection sampling gives you draws that are uniform by construction — so pick your range, press Generate, and let the numbers fall where they may.

Related tools

CalculatorsStopwatch & TimerPrecision stopwatch with laps, plus a countdown timer. CalculatorsPercentage CalculatorDiscounts, tips and change — every common percentage case. SecurityPassword GeneratorRandom passwords with a live strength readout, made on your device.