Random Number Generator

Set a minimum, maximum, and count to generate random integers or decimals instantly. Optional uniqueness enforces no duplicates; optional sorting orders the output. Descriptive stats (mean, min, max) are also shown.

How to use this calculator

  1. Set the minimum and maximum bounds for the range.
  2. Choose how many numbers to generate and whether duplicates are allowed.
  3. Select integer or decimal output and sort order.
  4. Click Calculate to regenerate — each run gives a different set.

Formula & method

Uniform random integer generation

x = Math.floor(Math.random() × (max − min + 1)) + min

Each integer in [min, max] has equal probability 1/(max−min+1). Decimal mode uses min + Math.random() × (max−min).

Example

Generate 5 unique integers in [1, 100], sorted ascending. Example: [12, 34, 56, 73, 91].

Key insights

How to interpret your result

Pseudo-random vs true random

Browser-generated numbers are pseudo-random (deterministic algorithm with a seed). For cryptography-grade randomness, use window.crypto.getRandomValues().

Uniqueness constraint

With no-duplicates, the tool uses rejection sampling. If count exceeds the range size, an error is returned.

Frequently asked questions

Is this truly random?
No — it is pseudo-random, generated by a deterministic algorithm. For most purposes (games, sampling, simulations) this is sufficient.
Can I generate random numbers without duplicates?
Yes — enable 'No duplicates'. The count must be less than or equal to the range size.
What is the range for random decimals?
Decimals are uniformly distributed between min and max, displayed to 4 decimal places.

Related calculators

See all math calculators · Explore all online calculators