Random Number Generator
True random numbers in any range — with or without repeats
This Random Number Generator picks numbers in any range you choose, using your browser's cryptographic random source — higher-quality randomness than the Math.random() most online generators use, with rejection sampling so every number in your range has an exactly equal chance.
Generate a single number or up to 1,000 at once. Turn on "No duplicates" to draw without repeats — that turns the generator into a raffle picker, lottery-style number draw, or a way to sample a random subset from a numbered list.
Common uses
- Raffles & giveaways — number the entries, draw winners without repeats
- Games — dice (1–6), decisions, random turn order
- Sampling — pick 20 random items from 500 for a quality check
- Testing — random values for spreadsheets and test data
Example
Your giveaway has 230 entries and 3 winners. Set min = 1, max = 230, how many = 3, enable No duplicates, click Generate.
You get three distinct entry numbers, each drawn with equal probability — e.g. 47 · 198 · 12.
Frequently Asked Questions
How do I pick a random number between 1 and 100?
Set minimum to 1, maximum to 100, and click Generate. Every number from 1 to 100 inclusive has an exactly equal 1% chance — the generator uses rejection sampling to avoid the subtle bias that naive modulo-based generators introduce.
Is this generator truly random?
It uses crypto.getRandomValues — your operating system's cryptographic randomness source, which mixes hardware entropy (timing jitter, interrupts). That's far stronger than Math.random() and unpredictable for all practical purposes. Philosophically 'true' randomness needs physical measurement (radioactive decay, atmospheric noise), but for draws, games and sampling this is indistinguishable.
How do I draw lottery numbers?
Example for a 6-of-49 lottery: min = 1, max = 49, how many = 6, and enable No duplicates. You get six distinct numbers, each combination equally likely — exactly like the physical draw. Remember it doesn't improve your odds; every combination, including 1-2-3-4-5-6, has the same probability.
How do I use this to pick a giveaway winner fairly?
Number your entries 1 to N in a fixed order (e.g. sorted by entry time), set the range to 1–N, generate, and announce which entry number won. For multiple winners enable No duplicates. Publishing the numbered list beforehand makes the draw verifiable by participants.
What does the 'No duplicates' option do?
It draws without replacement — like pulling numbered balls from a bag without putting them back. Each generated number is unique. With it off, every draw is independent, so repeats can occur (rolling a die twice can give two 6s).
Why do random numbers sometimes repeat or cluster?
Because that's what real randomness looks like. In 10 rolls of a die, repeats are expected (the chance of all-different is under 3%). Humans expect randomness to 'spread out' — actual random sequences have streaks and clusters. If a generator never repeated, it would be less random, not more.
What is the difference between Math.random() and crypto randomness?
Math.random() is a pseudorandom algorithm seeded once — fast, but its outputs can theoretically be predicted from previous outputs, and quality varies by engine. crypto.getRandomValues draws from the OS entropy pool and is unpredictable even to someone who has seen all previous values. For anything where fairness matters, crypto is the safer choice.
Can I simulate dice rolls?
Yes — a standard die is min 1, max 6. For two dice, generate 2 numbers with duplicates allowed and add them (don't generate 2–12 directly: the sum of two dice isn't uniform — 7 is six times likelier than 2). For a D20, set max to 20.
How do I generate random decimal numbers?
Generate integers in a scaled range and divide: for two decimals between 0 and 1, generate 0–100 and divide by 100. This keeps the distribution perfectly uniform. For most practical uses (prices, measurements for test data) that's exactly equivalent.
Is it possible to predict the next number?
Not feasibly. The numbers come from your operating system's cryptographic randomness, which is designed so that even an attacker who recorded every previous output cannot predict the next one. There's no pattern, seed or sequence to exploit.
How many numbers can I generate at once?
Up to 1,000 per click, with or without duplicates. For unique draws the range must be at least as large as the count — you can't pick 50 unique numbers between 1 and 10. Need more? Run it multiple times or use a spreadsheet function seeded from these values.
Can negative numbers be generated?
Yes — the range accepts any integers, including negatives. Min −50, max 50 works fine, as does a fully negative range like −100 to −1. The same equal-probability guarantee applies.