Random Number Generator

Generate cryptographically secure, uniformly sampled integers in an inclusive range.

by Calcuatany.com

This tool uses the browser cryptography API rather than Math.random(). It uses rejection sampling so every integer in the selected range has the same probability, avoiding the small bias that remainder or naive scaling methods can introduce.

The minimum and maximum are inclusive. Repeated values are allowed because each draw is independent.

How to use the Random Number Generator

  1. Enter the minimum and maximum integer.
  2. Choose how many values to generate.
  3. Select Generate again whenever you need a new independent set.
  4. Use a dedicated audited system for regulated lotteries, gambling, key generation or other high-stakes applications.

Formula

integer = minimum + unbiased secure random index

Example: five integers from 1 through 100

A minimum of 1 and maximum of 100 creates 100 possible values, including both endpoints.

Generating five values performs five independent draws, so a duplicate is possible and is not evidence of an error.

How to interpret the result

Uniform means each eligible integer has equal probability on each draw.

Random output is not expected to look evenly spaced in a small sample; clusters and repeats naturally occur.

Generation occurs locally, but the result can still be exposed if you copy, save or share it.

Next, you may also find these useful: Percentage Calculator, Fraction Calculator, Average & Standard Deviation.

Assumptions and limitations

  • Bounds are rounded inward: the minimum upward and maximum downward.
  • The resulting range must contain at least one integer and fit within the supported input limits.
  • Sampling is with replacement, so values are not forced to be unique.

Frequently asked questions

Are both endpoints included?

Yes. A range from 1 to 100 can return either 1 or 100.

Can numbers repeat?

Yes. Each draw is independent and sampling is with replacement.

Why not use Math.random()?

The browser cryptography API is intended for stronger randomness. Rejection sampling also avoids mapping bias.

Does the result leave my browser?

The calculation itself is local. Avoid sharing sensitive generated output.

Can this generate decimals?

No. It generates integers only; decimal bounds are rounded inward.

Is this suitable for a regulated drawing?

Use the audited process required by the relevant rules or regulator rather than relying on a general web tool.

Sources and further reading

Last reviewed: 2026-10-07. See our editorial policy.

Related calculators

For informational purposes only. Full disclaimer