Loading calculator...
Loading calculator...
Generate one or more random integers within a specified range, with an option for unique (non-repeating) numbers.
Random Integer Formula:
Random int in [min, max] = floor(Math.random() * (max - min + 1)) + min
For unique numbers, a Fisher-Yates shuffle is applied to the full range.
This generator uses JavaScript's Math.random(), which is a pseudorandom number generator (PRNG). It is suitable for most everyday uses but not for cryptographic security purposes.
Non-unique means the same number can appear multiple times (like rolling a die). Unique means each number can only appear once in the result, like drawing from a shuffled deck.
You can generate up to several hundred numbers at once. For unique numbers, the count cannot exceed the size of the range (max - min + 1).
This calculator generates random integers. For random decimals, you would multiply the result of Math.random() directly by the desired range.
The Fisher-Yates (Knuth) shuffle is an algorithm that produces an unbiased permutation of a list. It iterates backwards through the list, swapping each element with a randomly chosen earlier element.