Random Number Generator

Generate random numbers within any range you specify. Set minimum, maximum, and quantity. Free, instant, and runs entirely in your browser. No signup needed.

Pseudo‑random vs cryptographic random

Most web tools use Math.random(), which is a pseudo‑random number generator (PRNG). PRNGs start from a seed value and produce a deterministic stream of numbers that just looks random. Give the seed to anyone and they can reproduce the whole sequence. That's fine for games and simulations; it's terrible for draws, raffles, or anything where fairness matters. This tool uses crypto.getRandomValues() — the Web Crypto API — which pulls from the operating system's CSPRNG (on macOS/Linux it's /dev/urandom, on Windows it's BCryptGenRandom). That pool is seeded from real hardware entropy: mouse movements, disk timings, network jitter, thermal noise. It's the same source that browsers use to generate TLS session keys.

Avoiding modulo bias

A naive random % range gives you a number in the range, but some numbers become very slightly more likely than others when the range doesn't divide evenly into 2^32. For a 1–100 generator this is negligible, but for a 1–3,000,000,000 generator it's noticeable. The tool uses a rejection sampling pattern: draw a 32‑bit value, reject any draw that falls into the "biased tail," and retry. The result is a uniform distribution across your range, without the slight lean that modulo alone would produce.

When this tool is the right one

  • Social media giveaways — comment IDs 1 to N, pick a winner.
  • Classroom cold‑calling — pick student number 1 to 28.
  • Dice rolls for tabletop games — set min to 1 and max to 6, 20, or 100.
  • Sampling — pick a random row from a spreadsheet of length N.
  • Picking a user from a database for a spot‑check — use your user ID range.

When it's not

Regulated gambling (lotteries, casinos, state raffles) usually requires an audited RNG with published test reports — typically NIST SP 800‑22 or Dieharder suite results. Web Crypto is secure, but the audit trail is what regulators want, and this tool doesn't produce one. For official draws, use a certified provider. If you need reproducibility (same seed = same sequence, for testing code), Web Crypto is the wrong tool on purpose — it doesn't support seeded output.

Range and duplicates

Both min and max are inclusive. Negative values are supported. Each draw is independent, so if you pull 10 numbers from 1–100, duplicates can happen — that's how independent events work. If you want draws without replacement (e.g. pick 5 unique winners from 100 entries), generate more than you need and discard duplicates, or roll one at a time and keep a list.