Free Random Number Generator (Unbiased, In-Browser)
Generate one or up to 10,000 random integers in any inclusive range. Uses the browser's Web Crypto API with rejection sampling for a uniform distribution — no modulo bias, no signup, 100% in your browser. Free.
Cryptographic Strength
Uses `crypto.getRandomValues` — the browser's Web Crypto API — not `Math.random()`. Suitable for raffles, security tokens, and statistical sampling.
No Modulo Bias
Naive `bytes % range` skews the distribution on non-power-of-two ranges. We use rejection sampling against a 32-bit limit so every value in the range is equally likely.
Up to 10,000 Numbers
Generate a single value or a list of 10,000. Optional uniqueness constraint (no repeats), optional ascending sort, and one-click copy of the full list.
100% Client-Side
Random bytes are sourced from your local browser. Raffle picks, lottery numbers, and sampling results never leave your device — provably fair, provably private.
Random Number Generator: Unbiased Integers in Any Range
A random number generator produces unpredictable integers inside a range you set. This one takes an inclusive min and max plus a count of 1 to 10,000, then returns values from the browser's crypto.getRandomValues with rejection sampling so the distribution is uniform — no modulo bias. Toggle unique or sort ascending, then copy the list. It is free and runs 100% in your browser.
How to generate random numbers
- Set Min and Max — both are inclusive, so 1 to 6 covers every die face.
- Set How many from 1 to 10,000 — values above the cap are clamped down, below 1 are clamped up.
- Turn on Unique (no repeats) for lottery picks or sampling where each value must differ.
- Turn on Sort ascending to return the list in order instead of draw order.
- Press Generate, or click a preset (coin flip, D20, Powerball 5/69) to load and run canonical settings in one click.
- Press Copy to send the comma-separated result to your clipboard.
How a secure random number generator works
There are two classes of source. A non-cryptographic PRNG like JavaScript's Math.random() is fast and deterministic from an internal seed — fine for shuffling a deck or jittering an animation, but predictable and never safe for tokens or secrets. A CSPRNG (cryptographically-strong PRNG) like crypto.getRandomValues draws from the operating system's entropy pool and resists prediction. MDN's Web Crypto reference states it directly:
"Math.random() does not provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the Crypto.getRandomValues() method."— MDN Web Docs, Crypto.getRandomValues()
This tool uses crypto.getRandomValues(new Uint32Array(1)) per draw. To map a raw 32-bit value into your range without skew, it computes a rejection limit and re-rolls any value at or above it:
const range = (max - min) + 1; // inclusive
const limit = 2 ** 32 - (2 ** 32 % range);
let n;
do {
n = crypto.getRandomValues(new Uint32Array(1))[0];
} while (n >= limit); // reject the skewed tail
const result = min + (n % range); // uniformWorked examples: settings → output
Coin flip · min 0, max 1, count 1
0
Powerball 5/69 · min 1, max 69, count 5, unique, sorted
7, 23, 41, 52, 68
Test data · min 0, max 100, count 10 (repeats allowed)
88, 12, 88, 4, 57, 91, 12, 30, 76, 5
Edge case · modulo bias vs CSPRNG
Writing crypto.getRandomValues(...)[0] % 100 looks correct but is biased: 2³² = 4,294,967,296 divided by 100 leaves a remainder of 96, so values 0–95 land from 42,949,673 raw inputs while 96–99 land from only 42,949,672. The skew is tiny per draw but fails a chi-squared test over a large sample. Asking for more unique values than the range holds (say 100 unique in 1–50) returns a clear error instead of looping forever.
Preset reference: bounds and behaviour
The preset chips load these exact settings and run immediately. Min and max are inclusive; "unique" forbids repeats and "sorted" returns ascending order.
| Preset | Range | Count | Unique | Sorted |
|---|---|---|---|---|
| Coin flip | 0–1 | 1 | No | No |
| Six-sided die | 1–6 | 1 | No | No |
| D20 | 1–20 | 1 | No | No |
| Powerball 5/69 | 1–69 | 5 | Yes | Yes |
| UK Lottery 6/59 | 1–59 | 6 | Yes | Yes |
| 0–100 (test data) | 0–100 | 10 | No | No |
The browser limit and the rejection cap most tools never mention
The Web Crypto spec throws a QuotaExceededError if you ask getRandomValues for more than 65,536 bytes in a single call. This tool sidesteps that entirely by requesting one Uint32Array(1) (4 bytes) per draw, so even a 10,000-number run stays far under the quota.
There is a second guard buried in the math. Rejection sampling could in theory loop forever, so the generator caps re-rolls at 64 attempts; on the astronomically unlikely 64th miss it falls back to plain modulo with negligible bias. With a real CSPRNG the chance of even two consecutive rejections is below 0.25% for typical ranges, so the cap never fires in practice — it is a defensive belt, not a behaviour you will see.
Runs 100% in your browser
Your data never leaves your device. The random bytes are sourced locally by crypto.getRandomValues and copied with your browser's native clipboard — no uploads, nothing leaves your device. I tested every preset plus custom ranges at counts of 1, 100, and the 10,000 cap, with unique and sorted toggled on and off. Output stays instant even at 10,000 numbers, and the "more unique than the range allows" error fires correctly instead of hanging.
Frequently asked questions
Is this random number generator free?
Yes — 100% free with no signup, capped only at 10,000 numbers per run. The output is free to use in personal and commercial work.
Does it upload my data?
No. The random bytes come from crypto.getRandomValues, which runs in your browser, so nothing is sent to a server and it works offline once loaded.
Are min and max inclusive?
Both are inclusive. The range is [min, max], so min 1 and max 6 returns 1 through 6, and the range size is (max − min + 1).
Should I use this for secrets or tokens?
The source is a CSPRNG, so it is far safer than Math.random(). For passwords and API keys, prefer the dedicated Password Generator, which is built for that exact format.
Related randomness & developer tools
Random globally-unique identifiers
Password GeneratorCSPRNG-backed secret strings
Password Strength MeterCheck the entropy of a secret
Hash GeneratorSHA / MD5 digests from any input
HMAC GeneratorKeyed message authentication codes
Number Base ConverterConvert results to hex, binary, octal
QR Code GeneratorEncode a random code into a QR
Cron Expression BuilderSchedule randomized job runs
HTTP Status CodesReference for API responses
Guide: Strong PasswordsWhy length beats complexity
All ToolsBrowse the full Toolk hub
Last updated: June 2, 2026 · Runs 100% in your browser — no uploads, nothing leaves your device.
Need a different tool?
Browse all 89 free, in-browser tools — or tell us what we should build next.