Tools logoTools/
Math & Science/Random Number Generator

Random Number Generator

Generate cryptographically-secure random numbers in any range — single or batch.

Runs locally·Free, no signup·Updated May 6, 2026
Loading tool…
How it works

A walkthrough, end to end.

  1. 1

    Set the minimum and maximum (inclusive) and how many random numbers you want.

  2. 2

    Pick whether to allow duplicates.

  3. 3

    Click 'Generate' to roll new numbers — uses the browser's Web Crypto API for true randomness.

Reference

Crypto-secure RNG

Uses crypto.getRandomValues() — a CSPRNG (cryptographically secure pseudo-random number generator) backed by the operating system's entropy source. Suitable for password generation, lottery picks, and serious sampling.

Use cases

What you can do with this.

Lottery numbers

Generate 6 unique numbers from 1 to 49 (UK lottery). Set count = 6, min = 1, max = 49, no duplicates. Click generate as many times as you want.

Random password digits

Generate a string of digits for PINs or short codes. Set range 0-9 with length count, allow duplicates.

D&D / RPG dice rolls

1d20 = single number 1–20. 4d6 = 4 numbers 1–6. The calculator handles any custom range.

Sampling for surveys / research

Pick random subset from 1 to N records. With 'unique' enabled, you get a random sample without replacement.

Coin flips and yes/no decisions

Set range 0–1 to flip a coin (0 = tails, 1 = heads). Or 1–2. Either way works.

Random testing / fuzzing

Generate random integers as test inputs. The CSPRNG quality matters more for security than for testing, but it doesn't hurt.

Why crypto.getRandomValues?

Math.random() in older browsers had predictable output. crypto.getRandomValues uses OS entropy and is suitable for security-sensitive uses. The calculator uses crypto when available, falls back to Math.random.

RNG calculator 2026 — what's current

All modern browsers support crypto.getRandomValues. For non-cryptographic randomness, Math.random() is also fine. Quantum random number generators (QRNG) exist for academic research; for everyday use, classical CSPRNG is plenty.

FAQ

Frequently asked.

  • Cryptographically secure pseudo-random — sufficient for nearly all real-world applications including security, gambling, and statistical sampling. True randomness from quantum sources only matters for niche research.

  • Currently integer-only. For random decimals, divide the integer output by a power of 10 (e.g., generate 0–9999, divide by 100 for two-decimal random).

  • Yes — both endpoints are possible outputs. Range 1–10 can return 1, 10, or anything in between.

  • No. Generation runs entirely in your browser — no server, no logging.