Random Number Generator

Generate cryptographically random numbers โ€” single, decimal, or bulk โ€” in any range.

Ad
โ€”
click to generate
History
Ad

About This Random Number Generator

This generator uses crypto.getRandomValues() โ€” the browser's cryptographic randomness API โ€” with rejection sampling to eliminate modulo bias. This means the numbers are genuinely random, unlike JavaScript's Math.random() which uses a deterministic pseudo-random algorithm. Cryptographic randomness draws from your operating system's entropy pool, which includes physical sources like hardware timing variations.

Use Single mode to generate one number at a time with a history log. Use Bulk mode to generate up to 1,000 numbers at once, with an optional unique/no-duplicates constraint. Use Decimal mode for a random floating-point number in your specified range. Everything runs locally in your browser.


How to Use

  1. Set your Min and Max range.
  2. Choose a mode: Single, Bulk, or Decimal.
  3. Click ๐Ÿ”„ Generate or click the number display.
  4. Click โฟป Copy to copy the result to your clipboard.
  5. In Bulk mode, check Unique to ensure no duplicates.

Frequently Asked Questions

This tool uses crypto.getRandomValues(), which is a cryptographically secure random number generator (CSPRNG). It draws from your operating system's entropy pool โ€” sources of physical randomness like hardware interrupt timing. This is the same quality of randomness used for cryptographic keys and security tokens. It is far more unpredictable than Math.random(), which is a deterministic pseudo-random algorithm suitable only for non-security uses like games.

Modulo bias occurs when you use modulo arithmetic (% n) to reduce a random number to a range. If the random number's pool size isn't perfectly divisible by your range, some values appear slightly more often than others. This tool uses rejection sampling: it generates a random number and discards it if it falls in the biased region, retrying until an unbiased value is found. This ensures every number in your range has exactly equal probability.

No. All generation happens entirely in your browser. No data is sent to any server.

Ad