Generate a random integer between any two numbers
A random number generator (RNG) is a tool that produces a number that cannot be reasonably predicted better than by random chance. Our generator uses the crypto.getRandomValues() method, which provides cryptographically secure random numbers. This means the output is unbiased and suitable for applications where true randomness matters, such as giveaways, gaming, simulations, or selecting winners.
You can set any integer range – from negative to positive, small to large – and the generator will produce a uniformly distributed integer within that range.
The generator works by:
Because it uses true randomness (from the browser’s crypto API), each result is independent and equally likely.
Because the generator is browser‑based, you can use it offline, and it never sends data over the internet.
crypto.getRandomValues(), which is a cryptographically secure pseudorandom number generator. It is suitable for most applications requiring true randomness, including security‑sensitive contexts.crypto.getRandomValues() draws from a high‑entropy source and is considered cryptographically secure. For most practical purposes, it is effectively random.