Random Number Generator
Generate cryptographically secure random numbers using Web Crypto API. Customizable range, count, decimal precision, and unique values.
Random Numbers
Results update instantly as you type
Enter Values
Range
80
Embed Code
Copy and paste this HTML snippet into any web page to embed this calculator directly.
<iframe src="http://127.0.0.1:54963/embed/math/random-number-generator?ref=embed" title="Random Number Generator" width="100%" style="max-width:600px; border:none; height:500px;" loading="lazy"></iframe>
Direct Link
Share this link to let others open the calculator in their browser.
Generated Values (5)
Summary Statistics
Sum
243
Average
49
Minimum
13
Maximum
93
Randomness Source
Generated using crypto.getRandomValues() — cryptographically secure pseudo-random numbers suitable for most applications including security-sensitive use cases.
The Formula
This calculator uses the Web Crypto API (crypto.getRandomValues) to generate cryptographically secure pseudo-random numbers. Unlike Math.random(), the Web Crypto API is designed for security-sensitive applications and provides uniformly distributed values with no predictable pattern.
Variable Definitions
Minimum Value
The lower bound of the random range. Inclusive — the result can equal this value.
Maximum Value
The upper bound of the random range. Inclusive for integers, exclusive for decimals. For example, range [1, 100] can produce 100 for integers but not for decimals.
Count
How many random numbers to generate in a single batch. Maximum is 1000 per batch.
How to Use This Calculator
- 1
Set the minimum and maximum values for your range.
- 2
Choose how many random numbers to generate (up to 1000 per batch).
- 3
Select the number of decimal places (0 for integers, 1-5 for decimals).
- 4
Optionally enforce unique values (no duplicates) — useful for lottery numbers or sampling without replacement.
- 5
View sum, average, min, and max of the generated numbers for statistical insight.
Cryptographically secure random numbers (CSPRNG) are uniformly distributed and suitable for security applications.
Understanding the Concept
Random number generation is fundamental to simulations, statistical sampling, cryptography, gaming, and decision-making. This calculator uses cryptographically secure random number generation via the Web Crypto API (crypto.getRandomValues), which is suitable for most applications including security-sensitive ones. Unlike Math.random(), which uses a pseudo-random number generator (PRNG) seeded with the current time, the Web Crypto API draws entropy from the operating system's secure random source, making it unpredictable and suitable for cryptographic purposes. For integer generation, the range is uniformly sampled using modulo reduction of a 32-bit random value. For decimal values, a 32-bit random integer is mapped to the [0, 1) interval and scaled to your range. Note that true randomness includes occasional "patterns" and repeats — seeing three consecutive 7s in a sequence of random digits is not unusual and does not indicate a bug. True randomness is clumpy, which often surprises people who expect random numbers to appear evenly distributed.
Frequently Asked Questions
Sources & References
Related Calculators
Reviews
No reviews yet. Be the first to share your experience with Random Number Generator.
Write a Review
