Generate true cryptographically secure random integers or decimals with support for arbitrary precision up to 999 digits, batch generation, unique sampling, and custom sorting.
This version of the generator creates a random integer. It can deal with very large integers up to a few thousand digits.
This version of the generator can create one or many random integers or decimals. It can deal with very large numbers with up to 999 digits of precision.
A Random Number Generator (RNG) is a computational or physical system designed to generate a sequence of numbers or symbols that lack any discernible pattern, exhibiting statistical randomness.
Extracts entropy from physical, non-deterministic environmental phenomena such as thermal noise, radioactive decay, or atmospheric noise. They cannot be reproduced even if starting conditions are known.
Uses mathematical algorithms seeded with high-entropy OS noise (via crypto.getRandomValues()). Designed to make future output computationally impossible to predict from past outputs.
To avoid modulo bias when sampling integers in a non-power-of-two range [0, M], modern generators discard raw random bitstreams that fall above the largest multiple of the range and redraw. This ensures every candidate number has an exact, uniform probability of selection:
Standard JavaScript floats are limited to 64-bit IEEE-754 precision (~15-17 significant digits). This calculator scales the bounds to arbitrary BigInt integers at the requested precision, samples random bitstreams cryptographically, and formats the result with exact string decimal placement without precision loss.
Math.random() uses a standard PRNG (like xoshiro128**) which is not cryptographically secure and exhibits predictable state trajectories. The Web Crypto API taps into system-level entropy pools, providing uniform distribution suitable for security and unbiased statistical sampling.
The engine tracks previously chosen values in a Hash Set and redraws if a collision occurs. If the requested count exceeds the total number of integers in the specified range, the calculator immediately halts with a helpful validation message.
Modulo bias occurs when a random number generator that produces a large range (e.g. 0 to 255) maps values to a smaller range (e.g. 0 to 10) using simple modulo arithmetic (rand % 10). Because 256 is not evenly divisible by 10, lower numbers have a higher chance of being picked. Rejection sampling completely eliminates this bias.