Random Number Generator
Generate cryptographically secure random numbers within a range. Supports integers, decimals, and batch generation.
About the Random Number Generator
This random number generator runs entirely in your browser and uses the Web Crypto API (crypto.getRandomValues) to produce cryptographically secure random numbers. Set a minimum and maximum, choose how many numbers you need, and click Generate. Nothing is uploaded — all randomness is produced locally on your device.
What is a random number?
True random numbers come from physical phenomena such as radioactive decay or thermal noise. Computers, being deterministic, generate pseudo-random numbers using algorithms seeded by an entropy source. Cryptographically secure pseudo-random number generators (CSPRNGs) like the one behind crypto.getRandomValues use the operating system's entropy pool to produce numbers that are unpredictable enough for security-sensitive use.
CSPRNG vs PRNG
- PRNG (
Math.random()) — Fast, but predictable. Suitable for games, UI animations, and non-security contexts. Given the same seed, it produces the same sequence. - CSPRNG (
crypto.getRandomValues) — Slower but unpredictable. Required for security tokens, password resets, lottery draws, and any context where an attacker must not be able to predict the next value.
This tool uses the CSPRNG path so the output is suitable for any purpose.
Common use cases
- Lotteries and raffles — Pick winners fairly and unpredictably.
- Sampling and surveys — Select a random subset from a larger population.
- Gaming — Dice rolls, card shuffles, and loot drops.
- Statistics and simulations — Monte Carlo methods and randomized experiments.
- Security tokens — One-time codes and short-lived credentials (combine with stronger KDFs for production).
Frequently asked questions
How are the numbers generated? Using crypto.getRandomValues, the browser's cryptographically secure RNG backed by the OS entropy pool.
What is the maximum count? Up to 1000 numbers per click. For more, click Generate again or use a script.
Can I exclude duplicates? Yes, enable No duplicates when generating integers. The generator will retry until it finds unique values within your range.
How are decimals handled? Decimals are rounded to 6 decimal places. The range is inclusive of both min and max.