Advertisement

Random Number Generator

Generate true random numbers, pick random names from a list, or roll virtual dice — all powered by cryptographically secure randomness.

How True Randomness Works

This generator uses crypto.getRandomValues() — the same cryptographic API used for security-sensitive operations — instead of the predictable Math.random().

// Cryptographically secure random integer in [min, max]
range = max − min + 1
buffer = new Uint32Array(1)
crypto.getRandomValues(buffer)
result = min + (buffer[0] % range)

When to Use a Random Number Generator

  1. 1
    Fair Decisions
    Use the name picker for unbiased selection in giveaways, raffle draws, or team assignments.
  2. 2
    Board & Tabletop Games
    Roll any standard dice type (d4 to d100) for RPGs, war games, or board game simulations.
  3. 3
    Lottery Numbers
    Generate unique numbers in a range without duplicates for lottery or sweepstakes entries.
  4. 4
    Statistical Sampling
    Produce a sorted or unsorted sample of random integers for statistical experiments or classroom exercises.
'When duplicates are disallowed, each generated number appears at most once in the result set. This requires that the count you request is not greater than the size of the range (max − min + 1).'], ['question' => 'What are the different dice types for?', 'answer' => 'd4, d6, d8, d10, d12, and d20 are standard polyhedral dice used in tabletop RPGs like Dungeons & Dragons. d100 (percentile) is two d10s combined to give a 1–100 result.'], ['question' => 'How does the list shuffler work?', 'answer' => 'The shuffler uses a Fisher-Yates (Knuth) shuffle algorithm with crypto.getRandomValues for each random index selection, ensuring every permutation of the list is equally likely.'], ]" />

Related Calculators