Cryptographically Secure Random Number Generator
Unbiased integers, dice, and raw bytes from the CSPRNG.
About this tool
Math.random() is fine for games and fatal for secrets. This generator uses crypto.getRandomValues with rejection sampling, so integers in any range are exactly uniform — no modulo bias. Draw single numbers, dice pools, or raw bytes as hex.
Like everything on encrypt.tools, this runs entirely in your browser — nothing you enter is transmitted or stored.
Frequently asked questions about Random Numbers
Why not just use Math.random()?+
Math.random() is not cryptographically secure and is predictable. This tool uses crypto.getRandomValues, suitable for security-sensitive numbers.
What is rejection sampling?+
A technique that discards random values falling outside a clean range so every number in your range is exactly equally likely — no modulo bias.
Can it generate large ranges?+
Yes — any range within safe integer bounds, plus raw random bytes as hex.
Related tools
Password Generator
High-entropy passwords with a live strength meter
DICEWARE · WORDSPassphrase Generator
Memorable word-based passphrases, diceware style
UUID · V4/V7UUID Generator
Random v4 and time-ordered v7 UUIDs, in bulk
TOTP · RFC 6238TOTP Generator
Live 2FA codes from a Base32 secret