Random Number Generator
Pick numbers in any range — with or without duplicates, sorted or shuffled, copy-paste ready.
What this tool does
Generates random integers in any range you pick, in any quantity from 1 to 10,000. Toggle whether duplicates are allowed (off for lottery-style unique draws, on for simulating dice or coin sequences), choose to sort the output ascending or leave it shuffled, and pick the format you want — one number per line, comma-separated for spreadsheets, space-separated for quick CLI paste, or as a JavaScript array literal for code. Randomness is properly uniform: we use crypto.getRandomValues() with rejection sampling to remove the modulo bias that Math.random() % range introduces. For unique draws over dense ranges, we run a partial Fisher-Yates shuffle; for sparse ranges, a hash-set with retries. The whole thing runs locally — no upload, no logging, no rate limits.
How to use it
Set a min and a max — they can be negative, zero or anything in between. Set how many numbers you need. Decide whether to allow duplicates (turn off for raffles, on for repeated rolls). Decide whether to sort the output ascending. Pick a format: lines, comma, space or array. Hit Generate. The result appears in the panel; if you asked for one number, it shows huge; for many, it shows in a scrollable code block. Hit Copy to push the whole thing to your clipboard. Re-running with the same settings produces a fresh draw every time — there is no seed.
How the randomness works
Each draw samples a 32-bit integer from crypto.getRandomValues() and rejects any draw above floor(2^32 / range) * range. The accepted draw modulo range plus min is your number — provably uniform across the whole range. For unique draws, we use one of two strategies: when the range is dense enough (≤ 200,000 values), we materialise the full pool and partial-Fisher-Yates shuffle the first count entries — that's O(count), not O(range). When the range is sparse and big, we use a hash-set with retries — bounded by the 10,000-count limit so retries never explode. Sorting (when enabled) is a final ascending pass.
Common settings
A few example combinations to get you going.
| Use | Settings |
|---|---|
| Lottery numbers (5/49) | Min 1, max 49, count 5, duplicates off, sort on |
| Coin sequence (10 flips) | Min 0, max 1, count 10, duplicates on |
| Random colour byte | Min 0, max 255, count 1 |
| Pick 3 winners from 100 | Min 1, max 100, count 3, duplicates off |
Frequently asked questions
Is it really random?
crypto.getRandomValues() with rejection sampling, which is the standard CSPRNG approach for unbiased integer ranges.Why ask more uniques than the range allows?
Can I seed the RNG?
What's the maximum count?
Does it work with negative numbers?
max − min + 1, so make sure max ≥ min.
EN
PT
ES