Random Number Generator

Generate secure random numbers in any range, one or many at a time, each ready to copy.

Inclusive lower bound.

Inclusive upper bound.

Generate between 1 and 500 numbers at once.

Your random numbers will appear here, each with its own copy button.

Formula used

Secure integer in the inclusive range [min, max]:
  range   = max − min + 1
  raw     = crypto.getRandomValues(Uint32Array)   (32-bit unsigned)
  reject raw values ≥ floor(2³² / range) × range   (removes modulo bias)
  result  = min + (raw mod range)

Worked example

Range: min = 1, max = 6, count: 5

range = 6 − 1 + 1 = 6. Each draw takes a secure 32-bit value, rejects the biased tail, then maps it into 1–6.

Example output: 4, 1, 6, 3, 3 — each with its own copy button.

Frequently asked questions

How is this different from a normal random function?

It uses crypto.getRandomValues(), the browser's cryptographically strong random source, rather than Math.random(). The output is far less predictable, which matters for draws, tokens, passwords, and anything where guessability is a concern.

Are the minimum and maximum included in the range?

Yes. Both bounds are inclusive, so a range of 1 to 6 can return any whole number from 1 through 6, just like rolling a die.

Does it avoid bias toward certain numbers?

Yes. It uses rejection sampling — discarding the rare raw values that would skew the result — so every number in your range is equally likely, with no modulo bias toward the lower values.

Can numbers repeat when I generate several at once?

Yes. Each number is drawn independently, so repeats are possible and expected, exactly like rolling the same die multiple times. This is not a draw-without-replacement lottery picker.

Is the generation private?

Yes. Everything runs in your browser. No numbers, ranges, or results are sent anywhere.