Random Number Generator

Set a minimum, maximum and how many numbers you need to generate random whole numbers in your browser — choose whether duplicates are allowed.

Set your range and press Generate.

How the numbers are picked

To pick a whole number from min to max inclusive, scale a random fraction across the range:

n = min + ⌊ random × (max min + 1) ⌋

This tool draws its randomness from crypto.getRandomValues, the browser's cryptographically strong generator, rather than the weaker Math.random. Each value in the range is equally likely. For unique draws it keeps picking until it has the requested count of distinct numbers.

Worked example

One number from 1 to 100:

Range size: 100 − 1 + 1 = 100 possible values.
Scale: a random fraction × 100, floored, gives 0–99.
Shift: add the minimum (1) → a number from 1 to 100.

Random vs secure random

For lottery picks, raffles, sampling or games, ordinary randomness is fine. When unpredictability really matters — passwords, tokens, cryptographic keys — you want a cryptographically secure source, which is what this generator uses. Note that "unique" mode needs the range to be at least as large as the count, or there aren't enough distinct values to draw.

Tip: need a quick yes/no or a die? Try the dice roller. For secure passwords, use the password generator.

Frequently asked questions

How does this generate random numbers?

It scales a cryptographically strong random value (from crypto.getRandomValues) across your range, so every whole number from the minimum to the maximum is equally likely.

Can I generate unique numbers with no repeats?

Yes. Choose 'No duplicates' and it draws distinct values until it has the count you asked for. The range must contain at least that many numbers, or it can't fill the request.

Is the randomness truly random?

It uses the browser's cryptographically secure generator, which is suitable for raffles, sampling and games. No software generator is 'truly' random in a physical sense, but this is strong and unbiased.

Does anything leave my browser?

No. The numbers are generated locally on your device and nothing is sent to a server, so your results are private.

MB
Mustafa Bilgic · Editor, Calcool
Randomness comes from the Web Crypto API's crypto.getRandomValues, a cryptographically strong source. See the MDN Web Crypto reference. Everything runs in your browser.

Related calculators