How Random Number Generation Works
The default mode uses JavaScript's Math.random(), which returns a pseudo-random float uniformly distributed between 0 (inclusive) and 1 (exclusive). For integers, the formula is Math.floor(Math.random() × (max − min + 1)) + min. Both bounds are inclusive, so min and max can both appear in results.
For decimal output, the scaled value is rounded to the chosen decimal places using standard rounding (halfway rounds away from zero). Setting decimal places to 0 is equivalent to integer mode. The underlying PRNG is not cryptographically secure — it is well-suited for games, simulations, and statistics, but not for cryptographic keys or security tokens.
Unique Numbers and Duplicate Prevention
Enabling unique output ensures no value appears twice. For integer ranges up to 10,000 values wide, a Fisher-Yates shuffle is performed on the complete range array and the first N elements are selected. For larger ranges, rejection sampling draws one number at a time and discards duplicates. For decimal output, the formatted string (e.g. "3.14") is the uniqueness key. If the count exceeds available unique values, an error is returned.
Seeded Reproducible Results
A seed initialises a deterministic sequence using the mulberry32 algorithm. The same seed, range, and count always produce identical output — useful for classroom demonstrations, software testing, or sharing a specific random sequence. Changing any digit of the seed produces a completely different sequence. The seeded mode is not cryptographically secure.