Numbers & calculations

Random number

Let chance choose. Pick a whole number between your limits.

Your result—

How it works

Random number

Enter a minimum and a maximum. Both endpoints can be drawn. Web Crypto supplies randomness with rejection sampling to avoid modulo bias.

How to use this tool

  1. Enter the smallest and largest allowed integer, then Generate. Both endpoints are included.
  2. Generate again for another draw. Equal bounds always return that number; repeated draws may return the same value.

Understanding the result

The browser's cryptographic random source provides bytes. Rejection sampling avoids bias from reducing a random value into an interval of arbitrary size.

Worked examples

7…7 → 7

1…6

−5…5

Good to know

Integers from −1,000,000,000 to 1,000,000,000. For everyday use, not certified lotteries or regulated draws.

Bounds must be integers from −1,000,000,000 to 1,000,000,000 and minimum must not exceed maximum. This is not a certified lottery, password tool or draw without replacement.

A few quick answers

Why did I get the same number twice?

Each draw is independent. Repetition is possible and is not evidence that the generator is broken.

Sources and implementation

Implementation for this tool: crypto.getRandomValues · rejection sampling

Maintained by Chpl Limited · Updated:

A little break from ads.

Choose to view a rewarded ad and get 24 ad-free hours in this browser. No payment or account required.

There are no rewarded ads available right now. All tools are still free to use.

Optional advertising is off. If enabled later, it will only load after your choice. Tool inputs are never sent to analytics.