Random Number Generator
Generate cryptographically secure random numbers with custom range, count, sorting, and duplicate control
Pick a range, set a count, and generate numbers that are actually random — backed by the Web Crypto API, not the predictable Math.random() most sites quietly use. You get instant results with stats, sorting, duplicate control, and one-click copy or download. And everything runs in your browser. Nothing gets uploaded.
How It Works
The browser calls crypto.getRandomValues() to fill a typed array with random bytes from your OS. Those raw bytes get mapped to your chosen range using rejection sampling — a method that avoids the modulo bias you'd get from a naive approach. If you turned off duplicates, the tool keeps generating until it has enough unique values, then sorts or shuffles based on your settings.
Examples
Picking Raffle Winners
Your office has 85 people and you need to draw 3 winners for a gift card raffle. No repeats allowed.
Min: 1
Max: 85
Count: 3
Duplicates: Off
17, 42, 71
Simulating 10 Dice Rolls
Testing a board game prototype and you need quick dice rolls without digging through a drawer for actual dice.
Min: 1
Max: 6
Count: 10
Duplicates: On
3, 5, 1, 6, 2, 6, 4, 1, 3, 5
Generating Test Data for a Database
You're seeding a dev database with 50 user IDs between 10000 and 99999. Each ID must be unique, sorted ascending, and separated by newlines so you can paste into a SQL script.
Min: 10000
Max: 99999
Count: 50
Duplicates: Off
Sort: Ascending
Delimiter: Newline
10284
14037
18492
21756
...
97381
(50 unique sorted IDs)
Who Uses This
Seeding test databases, generating mock IDs, and stress-testing input validation with random values.
Rolling dice for D&D sessions, board game testing, or settling debates when nobody can find the physical dice.
Selecting random sample participants from a numbered list for surveys and clinical trials.
Picking random students for presentations, generating math problem sets, or creating lottery-style classroom rewards.
Common Mistakes
Asking for 100 unique numbers from a range of 1–50 is impossible. The tool will flag this, but it catches people off guard. Make sure your count doesn't exceed (max − min + 1) when duplicates are off.
Typing 100 as minimum and 1 as maximum won't break anything — the tool swaps them automatically. But it can confuse you if you're reading the settings back later. Just put the smaller number first.
Unique numbers come out in random order by default. If you need them sorted, change the sort dropdown to ascending or descending. Otherwise you'll get something like 47, 12, 83, 5 — unique but shuffled.
Technical Details
- Processing: 100% client-side — nothing leaves your browser
- Randomness Source: Web Crypto API (crypto.getRandomValues)
- Max Count: 1,000 numbers per generation
- Range Limit: JavaScript safe integers (±9,007,199,254,740,991)
- Browser Support: Chrome, Firefox, Safari, Edge
Frequently Asked Questions
Is this truly random or pseudo-random?
It's cryptographically random. The Web Crypto API taps into your operating system's entropy source — the same one used for generating encryption keys. It is not a seeded pseudo-random generator like Math.random().
Can I generate random numbers without duplicates?
Yes. Turn off the "Duplicates" toggle and every number in your result will be unique. Just make sure the range is large enough — you can't pull 50 unique numbers from a range of 1 to 20.
What is the largest number I can generate?
The maximum is 9,007,199,254,740,991 — that's JavaScript's Number.MAX_SAFE_INTEGER. For most practical uses (lotteries, testing, sampling), that range is more than enough. The minimum can go equally far into the negatives.
How many random numbers can I generate at once?
Up to 1,000 per click. That's a performance guardrail — generating more would slow down your browser tab. Need more? Just click generate a few times and combine the results.
Is my data stored or sent anywhere?
No. The numbers are generated entirely in your browser using JavaScript. Nothing is transmitted to a server. Disconnect from the internet and it still works — that's how local it is.