🔐 encrypt.tools
CSPRNG · UNIFORM

Cryptographically Secure Random Number Generator

Unbiased integers, dice, and raw bytes from the CSPRNG.

Free · no sign-up · runs locally·

loading tool…
FIELD NOTES

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.

COMMAND LINE

Do the same in a terminal

Reproduce or cross-check this tool with standard command-line utilities. For deterministic operations like hashing and encoding, the output matches exactly.

python3 -c 'import secrets; print(secrets.randbelow(100) + 1)'   # 1–100, CSPRNG
FREQUENTLY ASKED

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.

LEARN MORE
RELATED INSTRUMENTS