Random Number Generator

Generate a random integer within any range instantly. Click Generate for a new number each time.

1.7M usesUpdated · 2026-04-23Runs locally · zero upload

How to use

  1. Set the minimum and maximum values (integers).
  2. Click Generate to get a random integer in the range [min, max].
  3. Click again for a new number.

Algorithm

$$n = \lfloor \text{Math.random()} \times (\text{max} - \text{min} + 1) \rfloor + \text{min}$$

All integers in [min, max] have an equal probability of $\frac{1}{\text{max} - \text{min} + 1}$.

Frequently asked questions about Random Number Generator

Are the numbers truly random?

The generator uses JavaScript's Math.random(), which is a pseudo-random number generator (PRNG). It is suitable for games, sampling, and general use — but not for cryptographic purposes.

Can min equal max?

Yes. If min and max are equal, the only possible result is that number.

Can I use negative numbers?

Yes. You can set min to a negative value and max to a positive value to include the range across zero.