Random Number Generator
NewGenerate random numbers instantly. Set a custom range (min/max), generate multiple numbers at once, and choose between integer or decimal mode. Free and private.
How to Use Random Number Generator
- Select Integer or Decimal mode for whole or fractional numbers.
- Enter a minimum and maximum value to define your range.
- Set how many numbers to generate (up to 1,000).
- For decimals, choose how many decimal places to include.
- Click "Generate" to create your random numbers.
- View statistics (min, max, average) when generating multiple numbers.
- Click "Copy" to copy results to your clipboard.
How Random Number Generation Works
Random number generation is a fundamental operation in computing, used in everything from games and simulations to statistical sampling and cryptography. This tool uses a Pseudorandom Number Generator (PRNG) to produce numbers that are statistically random for practical purposes.
For integer mode, the formula used is: Math.floor(Math.random() * (max - min + 1)) + min. This ensures every integer in the range [min, max] has an equal probability of being selected (uniform distribution).
For decimal mode, the formula is: Math.random() * (max - min) + min, rounded to the specified number of decimal places. This produces uniformly distributed floating-point numbers within the given range.