Everyday Math
· Reviewed by Ali Abbas

Random Number Generator

True Random vs Pseudo-Random — Full Explanation

There are two categories of random number generators. True Random Number Generators (TRNGs) derive randomness from physical processes — atmospheric noise, radioactive decay, or thermal noise — and are theoretically unpredictable. Pseudo-Random Number Generators (PRNGs) use deterministic algorithms seeded with an initial value to produce sequences that appear random. CalkHub's generator uses crypto.getRandomValues(), a cryptographically secure PRNG seeded by the operating system's entropy sources (hardware interrupts, mouse movements, keystroke timings).

Use CaseRecommended GeneratorWhy
Lottery / raffle drawsCSPRNG (this tool)Statistically uniform, provably fair
Statistical samplingCSPRNG (this tool)Sufficient randomness, fast generation
Video games / diceAny PRNGSpeed over perfect randomness
Cryptographic keysHardware TRNGMust be unpredictable by any adversary
Scientific simulationsCSPRNG (this tool)Good distribution, reproducible with seed

Common Applications of Random Numbers

Random numbers appear in more places than most people realise. Online casinos use them for card shuffles and slot outcomes. Gaming platforms use them for loot drops, enemy spawns, and procedural world generation. Statistical software uses them for bootstrapping, cross-validation, and Monte Carlo simulations. Cryptographic systems depend on high-quality randomness for key generation, nonces, and initialisation vectors. In scientific research, randomisation ensures unbiased treatment assignment in clinical trials and fair sampling in population surveys. Each application requires a different level of randomness quality, and CalkHub's CSPRNG is suitable for all non-cryptographic uses and most statistical applications.

Why Cryptographic Seeding Matters

The crypto.getRandomValues() API draws entropy from the operating system's secure random source, which aggregates hardware noise — thermal fluctuations in CPU cores, timing variations in disk I/O, and network packet inter-arrival times. This means the random sequence cannot be predicted even if an attacker knows the algorithm, unlike older PRNGs such as Math.random() which can be reverse-engineered after observing a few hundred outputs. For any application where fairness, security, or statistical validity matters, a CSPRNG is the minimum acceptable standard.

For most everyday uses — classroom draws, game dice rolls, random team assignments, and statistical sampling — the generator on this page provides more than enough randomness quality. For cryptographic key generation or security-critical applications, however, always use a dedicated hardware security module or operating-system-level TRNG.

What Are Random Numbers?

A random number is a value generated by a process with no predictable pattern — each outcome is independent of the previous one. Random numbers are fundamental to statistics, gaming, lottery draws, cryptography, scientific simulation, and fair selection processes.

True Random vs Pseudo-Random Numbers

Pseudo-Random (PRNG)

Most computers generate pseudo-random numbers using mathematical algorithms seeded from a starting value. They are statistically uniform and practically indistinguishable from true random for most uses, but are deterministic — the same seed produces the same sequence.

True Random (TRNG)

True random numbers come from genuinely unpredictable physical phenomena — radioactive decay, thermal noise, or atmospheric events. Services like RANDOM.ORG use atmospheric noise. Our generator uses JavaScript's cryptographically seeded PRNG, which is suitable for all non-security uses below.

How to Use This Generator

Enter a minimum and maximum value, choose how many numbers you need, and click Generate. Numbers are uniformly distributed — each has equal probability. Enable No Duplicates for sampling without replacement.

Common Use Cases

Use CaseMinMax
Coin flip01
Standard dice (d6)16
UK National Lottery159
US Powerball (main)169
D&D d20120
Percentage roll1100

Frequently Asked Questions

Is this truly random?

Our generator uses a cryptographically seeded PRNG producing statistically uniform results. For security-critical purposes, use a dedicated cryptographic RNG library.

Can the same number appear twice?

Yes, by default (sampling with replacement). Enable No Duplicates to ensure each number appears only once.

Related Tools

Percentage Calculator — calculate probabilities from your results. GCD & LCM Calculator — explore more mathematical tools.

Worked example — classroom draw: A teacher has 30 students and needs to randomly select 5 for a presentation. Using the random number generator: set range 1–30, generate 5 numbers, enable "unique" mode to avoid repeats. Result: e.g. 7, 14, 22, 3, 29. The same process works for raffle tickets, exam seat assignments, and team allocations — fair, instant, and verifiable.

Random numbers play a vital role in modern life — from the lottery ticket you buy to the A/B test a website runs to the shuffle algorithm in your music player. This generator provides genuinely high-quality randomness suitable for all everyday applications, and its cryptographic seeding ensures results you can trust.

From selecting a random winner in a social media giveaway to generating unbiased test data for a software project, having a reliable source of random numbers saves time and ensures fairness across countless everyday scenarios.

How to Use

  1. 1
    Choose what to randomiseSelect a tab: Number (range), Multiple Numbers, Dice, Coin Flip, or pick from a custom list.
  2. 2
    Set your parametersFor numbers, enter min and max. For dice, choose type and quantity. For lists, paste your items.
  3. 3
    Click GenerateHit the Generate button to get your cryptographically random result instantly.

Frequently Asked Questions

Is this random number generator truly random?
It uses the Web Crypto API (crypto.getRandomValues()), which is a cryptographically secure pseudo-random number generator (CSPRNG). While technically pseudo-random (generated by an algorithm), it is seeded with hardware entropy and is indistinguishable from true randomness for all practical purposes.
How do I generate a random number between 1 and 10?
Set Min to 1, Max to 10, and click Generate. The result will be a whole number between 1 and 10 inclusive.
Can I generate random numbers without duplicates?
Yes — in the Multiple tab, check the "No duplicates (unique)" option before generating. This ensures each number in your list appears only once.
How do I pick a random winner from a list?
Use the "From List" tab. Enter each participant's name on a separate line, set "How many to pick?" to 1 (or more for multiple winners), and click Pick Random.
What are the odds of rolling a specific number on a D20?
Each face on a D20 (20-sided die) has a 1/20 = 5% probability. Rolling a natural 20 (critical hit in D&D) happens 5% of the time, or roughly once every 20 rolls.
Share