Skip to main content

Free Random Number Generator

Generate random numbers in any range, create unique number lists, or roll dice. Uses cryptographically secure randomness.

Works offline once loaded

🔒 Every number uses your browser's cryptographically-secure randomness (crypto.getRandomValues) — genuinely fair, not the predictable Math.random(). Nothing is sent anywhere. Even so, do not use these numbers for cryptographic key generation, security tokens, or regulated lottery/gambling applications, which require audited, hardware-certified randomness sources.

Need to pick a winner by name from a list, or flip a coin? Use the Coin Flip, Spin Wheel and List Picker tool →

Common uses

  • Generate Lottery NumbersPick random lottery numbers for Powerball, Mega Millions, EuroMillions, and other draws.
  • Pick a Random Winner for GiveawaysFairly select a random winner from a numbered entry list for competitions and giveaways.
  • Roll Dice for Tabletop GamesRoll any combination of dice — d4, d6, d8, d10, d12, d20, d100 — for D&D and tabletop RPGs.
  • Random Sampling for ResearchGenerate random samples, assign random IDs, or select a random subset from a numbered dataset.
  • Generate Test Data Random NumbersCreate large lists of random numbers for testing algorithms, filling databases, and stress-testing systems.

How It Works

Every number this tool generates comes from crypto.getRandomValues — the browser's cryptographically secure random source, the same one used for TLS key generation. A hand-written rejection-sampling algorithm sits on top to eliminate the modulo bias that plagues simple Math.random() % range implementations, including ranges wider than 2^32 via BigInt arithmetic.

  1. 1
    Set your range and mode
    Choose between a single number, a batch list (up to 1000), or polyhedral dice (d4 through d100). For lists you can also require unique values and optionally sort the output ascending.
  2. 2
    crypto.getRandomValues draws raw entropy
    Each number is drawn from a Uint32Array (or BigUint64Array for ranges wider than 2^32) filled by the browser's cryptographic RNG — not Math.random(). Rejection sampling then discards values that would skew the distribution, so every integer in your range has exactly equal probability.
  3. 3
    Unique-value mode uses Fisher-Yates or rejection tracking
    When unique mode is on and the range fits in memory (up to 100,000 values), the tool materialises the full pool and shuffles it with Fisher-Yates. For very large ranges it instead draws values one at a time, skipping repeats — avoiding the memory cost of constructing a billions-entry array.
  4. 4
    Results land with animated feedback and stay in session history
    The final values animate into place (a slot-machine roll for numbers, tumbling dice for dice mode) using requestAnimationFrame, then appear in a scrollable history log you can copy at any time. Nothing leaves your browser.

Related Tools

Frequently Asked Questions