application.ist

Math

Random Number Generator

Generate random numbers in a range.

Numbers generated

โ€”

Min / Max

โ€”

Sum

โ€”

Results

โ€”

FAQ

Why use crypto.getRandomValues instead of Math.random?
crypto.getRandomValues uses the operating system's cryptographically secure pseudo-random number generator (CSPRNG), which provides far better statistical unpredictability than Math.random. This matters for any use case where guessability is a concern, such as tokens, game seeds, or sampling.
What happens when "no duplicates" is checked but count exceeds the range?
If the number of unique integers available in [min, max] is smaller than the requested count, the generator will produce as many unique values as possible (the full range) and then stop โ€” it will not loop infinitely.
Is my data sent anywhere?
No. All generation happens entirely in your browser using the built-in Web Crypto API. Nothing is uploaded or logged.

Related tools