Free & unlimited

Random Number Generator

Generate one or more random numbers in a range using a secure random source.

What this tool does

Generates one or more random whole numbers within a range you set — for drawing a giveaway winner, rolling dice, picking a random sample, assigning an order, or seeding a game. It runs in your browser, so nothing you enter leaves your device.

Numbers come from your browser's Web Crypto random source (crypto.getRandomValues), not Math.random(). Random bytes are mapped onto your range with rejection sampling, so every value in the range is equally likely.

How to use this tool

1Set the minimum and maximum — both ends are included in the range.
2Choose how many numbers you want.
3Turn "allow duplicates" off if every number must be unique (for a draw, say) or on if repeats are fine (like dice rolls).
4Click Generate, then Copy All to paste the results elsewhere.

Why the random source matters

Math.random() is designed for speed, and the JavaScript specification leaves its algorithm up to each browser. The Web Crypto API is the interface browsers provide for security-sensitive randomness such as tokens and keys, so this tool uses that instead. A 32-bit random value is mapped onto your range by rejection sampling: any draw that falls in the uneven leftover slice at the top of the 32-bit span is thrown away and drawn again, which avoids the slight skew that a plain remainder (modulo) operation would add. For ranges wider than 232 the tool draws 53 random bits instead and applies the same rule.

For a public draw, that's the difference between “random” and “defensibly random”. For a serious prize, still record how you did it — screen-record the draw, or note the range and count — since the result itself can't be reproduced or audited afterwards.

Is this a true random number generator?

Strictly, no — and for almost every use that doesn't matter. A true random number generator (TRNG) reads a physical process such as electrical noise or radioactive decay. A cryptographically secure pseudo-random generator (CSPRNG), which is what the Web Crypto API provides, stretches unpredictable seed entropy gathered by your operating system into a stream that can't be predicted without knowing its internal state.

Browsers use this same source to generate encryption keys, so it is more than random enough for giveaways, games, sampling and classroom draws. If you need certified physical randomness, for a regulated lottery for example, use a hardware generator or a service that publishes its entropy source.

FAQ

Can I reproduce a previous result?
No. There's no seed you can set — each generation is independent and secure by design, so results can't be replayed. If you need reproducibility, that's a different kind of tool.
How do I generate unique numbers with no repeats?
Turn off "allow duplicate numbers". Every number will be distinct, as long as the range holds at least as many values as the count you asked for.
How is the number kept unbiased?
Values from the browser's random source are accepted only if they fall inside the largest block that divides evenly by your range size; anything else is discarded and redrawn. Every value in the range then has the same chance. The quality of the underlying randomness still depends on the browser's Web Crypto implementation.
What's the largest range or count I can use?
Min and max must be whole numbers between -9,007,199,254,740,991 and 9,007,199,254,740,991 (the largest range JavaScript can count exactly), and the count is capped at 1000 per generation. With duplicates turned off the range is limited to 1,000,000 values, because the tool shuffles the whole range to guarantee uniqueness; with duplicates on there is no such limit.
Are the numbers in a result sorted?
No. They appear in the order they were drawn. Sort them yourself after copying if you need ascending order. With duplicates off, the order is also random because the shuffle is random.

Sources

The tool uses the browser interface defined in the W3C specification below. The rejection-sampling method is a standard technique we implemented ourselves.

  1. W3C Web Application Security Working Group (2025). “Web Cryptography Level 2 (First Public Working Draft), Crypto.getRandomValues.” W3C. w3.org/TR/WebCryptoAPI — Defines getRandomValues, which fills a typed array with cryptographically strong random values.

Last reviewed: October 2026