HOW IT WORKS
Unbiased random sampling with crypto.getRandomValues
Standard Math.random() implementations are not guaranteed to be cryptographically uniform and naive modulo reduction introduces bias when the range does not divide 2³² evenly. This generator uses your browser's Web Crypto API.
Rejection sampling for integers
Each 32-bit unsigned integer from crypto.getRandomValues is rejected if it falls in the partial remainder bucket above the largest multiple of the range width, ensuring every integer has an identical probability.
P(X = k) = 1 ÷ (max − min + 1)Unique draws without replacement
When “Allow duplicates” is unchecked, the generator uses a partial Fisher–Yates shuffle (or hash-set tracking for wide ranges) so no number repeats.
53-bit uniform decimals
Decimal mode combines two 32-bit draws into a 53-bit IEEE-754 mantissa in [0, 1), scales it to [min, max], and rounds to your chosen decimal precision.