Random Number Generator
Generate random integers or decimal numbers within a specified minimum and maximum range.
Up to 1000 numbers can be generated at once.
Input
Output
What is a Pseudo-Random Number Generator (PRNG)?
Computers are deterministic machines — they follow a fixed set of instructions and cannot produce truly random numbers on their own. Instead, they use algorithms called Pseudo-Random Number Generators (PRNGs) to produce sequences of numbers that appear random.
A PRNG starts from an initial value called a seed. Given the same seed, a PRNG will always produce the exact same sequence of numbers. This predictability makes PRNGs unsuitable for security-critical applications but very useful for simulations, games, and statistical sampling.
This generator uses PHP's random_int() function, which draws from the operating system's Cryptographically Secure Pseudo-Random Number Generator (CSPRNG) — sources like /dev/urandom on Linux or CryptGenRandom on Windows. The seed is gathered from hardware entropy (thermal noise, interrupt timing, etc.) and is never fixed or user-controllable, so every call produces genuinely unpredictable output. This makes it suitable even for cryptographic and security purposes.
By contrast, the older mt_rand() function uses the Mersenne Twister algorithm — fast and statistically good, but its internal state can be reconstructed after observing enough outputs, making it cryptographically weak.