Cryptographically secure random numbers in any range. Free, private, runs in your browser.
100% private — your files never leave your browser. All processing happens locally on your device.
JavaScript's built-in Math.random() is a linear congruential generator — it produces the same sequence every time if you know its internal state. It's adequate for casual use but unsuitable for draws, lotteries, secure token generation, or anything where predictability would matter. This tool uses the Web Crypto API's getRandomValues(), which seeds from the operating system's entropy source (hardware noise, thermal variations, user input timing — depending on the platform). The result is cryptographically secure randomness in your browser, with zero server roundtrips.
A naïve random-in-range uses `Math.floor(Math.random() * span) + min`. For most uses this is fine, but when span doesn't divide evenly into the 2^32 random space, certain values become slightly more likely than others (modulo bias). The tool uses rejection sampling: draw a full 32-bit value, discard it if it falls in the 'biased zone', otherwise map to the range. Slightly slower in the worst case, perfectly uniform in the limit.
By default, values are drawn with replacement — duplicates are possible. Enable 'Unique values only' when you need N distinct values from a range, for example drawing lottery numbers, picking raffle winners from a list, or assigning unique IDs. The generator keeps drawing until it has N non-duplicate values. If you ask for more unique values than the range can provide (say 10 unique values in 1–5), the tool tells you it's impossible rather than looping forever.
Sort the output ascending or descending — handy for drawing sorted sequences. A one-click copy button puts the values in your clipboard as a newline-separated list, ready to paste into a spreadsheet or script. Generate up to 10,000 values in a single click; beyond that, a dedicated script is better than a browser tab.
No values are transmitted, logged, or shared. If you're using this for a giveaway, lottery, or any draw where fairness matters, the fact that no server saw the numbers is a feature — nobody can claim the result was tampered with between client and server, because there was no server.
Math.random() is a seeded pseudo-random generator — predictable if you know its state, and unsuitable for anything security-sensitive (draws, lotteries, unique IDs, passwords). This tool uses crypto.getRandomValues() with rejection sampling to avoid modulo bias. Cryptographically secure, uniformly distributed, suitable for anything short of key generation.
When you need N distinct values from a range — drawing lottery numbers, assigning unique IDs to a finite set, random sampling without replacement. The tool rejects duplicates as it generates until you have the count you asked for. Won't let you ask for more unique values than the range contains.
10,000 per click. More than that starts to get slow in the browser, and real use cases rarely need more. For huge batches, a proper dedicated tool or a shell one-liner is better.