Random Number Generator
Generate random numbers instantly. Set your min, max, and quantity.
Generate random numbers instantly. Set your min, max, and quantity.
Most software uses pseudo-random number generators (PRNGs) — deterministic algorithms seeded with a value. Cryptographically secure random numbers use hardware entropy sources and are unpredictable even if the algorithm is known.
No — Math.random() is a PRNG seeded from a small entropy source. It can be predicted if an attacker observes enough outputs. For password generation and cryptographic keys, always use crypto.getRandomValues() (browser) or crypto.randomBytes() (Node.js).
Basic: Math.floor(Math.random() * (max - min + 1)) + min. Cryptographically secure: const arr = new Uint32Array(1); crypto.getRandomValues(arr); const num = (arr[0] / 2**32) * (max - min) + min;. The crypto version uses OS-level entropy.
Uniform distribution (equal probability) is the default and suits dice, card draws, and random samples. Normal (Gaussian) distribution suits modeling natural variation (heights, errors). Poisson suits rare events over time (server requests per second). Choose based on your real-world model.