Random Number Generator
Use this free random number generator to instantly produce a random integer between any two numbers. Enter a minimum and maximum value to get started.
What Is a Random Number Generator?
A random number generator (RNG) is a tool that creates a number selected unpredictably from a specified range. In most cases, these generators produce numbers that appear random and are suitable for simple simulations, games, statistics, or decision-making.
Computers use mathematical formulas and algorithms to generate numbers that are pseudorandom, meaning they mimic randomness but are deterministic.
How Random Numbers Are Generated
The typical formula used to generate a random integer between a and b is:
Random = Math.floor(Math.random() × (max − min + 1)) + min
- min = smallest possible number
- max = largest possible number
- Math.random() = generates a value between 0 and 1
Example
Example: Generate a random number between 10 and 20.
The generator may return values such as:
13, 17, 11, 20, 14...
Each output is unpredictable and can be any integer within the range.