Random Number Generator
Generate random numbers with various options and ranges.
Code Examples
// Pseudorandom (0-1)
Math.random();
// Random integer in range
Math.floor(Math.random() * (max - min + 1)) + min;
// Cryptographically secure
crypto.getRandomValues(new Uint32Array(1))[0];Frequently Asked Questions
Are these random numbers truly random?
The cryptographic option uses your browser's crypto.getRandomValues() which provides cryptographically strong random values. Standard mode uses Math.random() which is pseudorandom.