Random Number Generator
Generate random numbers within any range using cryptographic randomness. Supports bulk generation up to 10,000 numbers, no-duplicates mode, and sorted output.
Uses crypto.getRandomValues() with rejection sampling for unbiased results.
Cryptographic vs. Pseudo-Random Numbers
Most programming languages provide a "random" function based on a deterministic algorithm (PRNG — pseudo-random number generator). These produce numbers that look random but are actually predictable if you know the seed. For games, simulations, and non-security uses, PRNGs are fine.
For anything requiring fairness (raffles, cryptography, security), use a CSPRNG (cryptographically secure PRNG). This generator uses crypto.getRandomValues(), which draws from hardware entropy sources — the results are genuinely unpredictable and not reproducible.
Rejection sampling technique used here: const range = max - min + 1; const maxValid = Math.floor(0xFFFFFFFF / range) * range; — discard values ≥ maxValid to eliminate modular bias, then compute min + (rand % range).
Random Number Generator FAQs
Is this random number generator truly random?
What is rejection sampling?
What does "no duplicates" mean?
How do I pick a random winner from a numbered list?
Can I generate random lottery numbers?
What is the maximum number of numbers I can generate?
Related Tools
QR Code Generator
Create free QR codes for URLs, WiFi, email, and more. Download as PNG or SVG. No signup.
Word & Character Counter
Count words, characters, sentences, and reading time. Works for essays, tweets, and content.
Aspect Ratio Calculator
Calculate proportional dimensions for any aspect ratio. Perfect for images, video, and design.