Random Number Generator
Generate random integers or decimals with optional uniqueness. Integer endpoints must be safe integers, and the inclusive range may contain at most 2^53 values.
Inclusive Random Number Range Examples
| Minimum | Maximum | Possible integers |
|---|---|---|
| 1 | 6 | 6 |
| 1 | 100 | 100 |
| -10 | 10 | 21 |
| 0 | 1 | 2 |
| 1 | 1,000 | 1,000 |
Frequently Asked Questions about the Random Number Generator
Is this random number generator truly random?
It is a pseudorandom generator. The calculator uses Web Crypto when available and Math.random only when Web Crypto is absent. Its integer path uses rejection sampling for supported ranges. It is useful for casual draws and simulations, but it is not an auditable physical-randomness service or a certified contest system.
Can I use this for a giveaway or contest?
You can use it for an informal draw by assigning entry numbers and requesting unique integers. For a regulated promotion, use rules, recordkeeping, and a drawing method that meet the applicable jurisdiction and platform requirements. This page does not create an audit trail or certify the draw.
What is the maximum range?
You can request up to 1,000 results. In integer mode, the inclusive range can contain up to 2^53 distinct values because the rejection sampler combines random values into a 53-bit sample. Both endpoints must remain within JavaScript's safe-integer range.
Why does 'unique values' fail sometimes?
For integers, it fails when you request more unique numbers than the range contains - for example, 10 unique integers between 1 and 5 is impossible. In decimal mode, values are generated as JavaScript numbers without display rounding before uniqueness is checked. A very narrow range can still fail because the generator stops after a bounded number of attempts.
Does selecting unique values change the odds?
It prevents repeats. In integer mode, the calculator samples without replacement, so every feasible set of requested values has the same probability. Selecting unique values does not make one individual value more likely than another.
Related Calculators
More calculators in "Tech"
Dice Roller (d4-d100)Aspect Ratio CalculatorDPI Calculator (Pixel Density)Subnet Calculator (IPv4 CIDR)Base Converter (Binary, Hex, Octal)Hash Generator
See all 98 calculators in "Tech"