Random Number Generator
Generate random numbers within your specified range
Features
- Set custom minimum and maximum values
- Generate multiple numbers at once (up to 100)
- Option to allow or prevent duplicate numbers
- Copy results to clipboard
What this generator actually calls — and what to use instead
This tool builds integers from Math.random(). In V8 (Chrome, Edge, Node) that's implemented as xorshift128+, a PRNG with 128 bits of state that returns a double in [0, 1) (v8.dev/blog/math-random). It passes TestU01 BigCrush, but it is not a CSPRNG: the internal state is recoverable from ~5 consecutive outputs, and V8 caches a batch of 64 values at a time so outputs aren't even strictly sequential across ticks. Firefox's SpiderMonkey uses the same family. Good enough for raffles, bad for tokens.
If you need unpredictability — session tokens, password salts, shuffle a deck nobody can reverse — use crypto.getRandomValues(new Uint32Array(1)). It's backed by the OS CSPRNG (getrandom/BCryptGenRandom/SecRandom) and is W3C-specified to be cryptographically random. Two common misuses to avoid here: (1) bias — doing x % n on a 32-bit random int when n doesn't divide 2^32 gives a small but non-zero skew toward low values, mattering only at cryptographic scale; (2) seeding — you can't seed Math.random in the browser, so "reproducible" runs need a userland PRNG like mulberry32. This generator is fine for picking a winner from 500 names; it is not fine for a $10,000 giveaway that needs an auditable draw.