Random Number Generator
Need a lucky number, a raffle winner, or a random sample? Set your range, choose how many numbers you want, and generate — every draw uses your browser’s cryptographic random generator, the same kind used for security keys.
Generate your random numbers
Range & options
Set the range, how many numbers you need, and how they should behave.
Lowest number that can appear, included in the results.
Highest number that can appear, also included.
Up to 1,000 numbers per draw.
Raffles usually want low-to-high; dice-style draws stay unsorted.
Integers are whole numbers (1, 2, 3). Decimals include fractions, e.g. 4.27.
How many digits after the point — 2 gives numbers like 4.27.
Off by default: every number appears at most once, like drawing names from a hat. Turn it on for dice-style rolls where repeats are fine.
Results
Your numbers will appear here — press Generate.
Numbers come from your browser's cryptographic random generator (the same kind used for security keys) — not the weaker Math.random().
Recent draws
Your last 10 draws, newest first. Cleared when you leave the page.
- Nothing generated yet.
How Random Number Generation Works
True randomness is surprisingly hard to produce on purpose. A computer is a deterministic machine — given the same input, it always produces the same output — so generating a genuinely unpredictable number takes special effort. The generator above uses your browser's cryptographically secure random source: the same built-in system browsers rely on for creating passwords, encryption keys, and secure login tokens. It draws from unpredictable physical events inside your device (tiny variations in timing, hardware noise) rather than from a simple arithmetic formula.
Why does the source matter? Many casual random functions use a recipe called a pseudo-random formula: start from a "seed" number, then apply arithmetic that scrambles it into something that looks random. For games and animations that is usually fine. But pseudo-random sequences have a weakness: if someone learns the seed or the formula's internal state, every future number becomes predictable. That is acceptable for shuffling a playlist and unacceptable for picking a raffle winner, assigning a random drug-trial group, or drawing contest entries — anywhere money, fairness, or trust is on the line. The secure source used here has no predictable seed to steal, which is why it is the right choice for anything that must be fair.
Once a raw random value exists, turning it into "a number between 1 and 100" requires one more careful step. The naive approach — take the random value and squeeze it into the range with division remainders — can introduce a subtle bias: some numbers in the range become microscopically more likely than others. The correct method discards any raw value that would create that bias and draws again, so every number in your range has exactly the same probability. You will never notice the extra draws — they happen in microseconds — but the fairness guarantee depends on them.
Two options on the generator deserve explanation. "Allow duplicates" (sampling with replacement) means each draw is independent: rolling "a number from 1 to 10" five times can absolutely produce 7 twice, just like flipping a coin can land heads twice in a row. "No duplicates" (sampling without replacement) removes each drawn number from the pool, like dealing cards from a deck — perfect for lotteries, secret-Santa assignments, and raffles where each entry can win only once. If you ask for more unique numbers than the range contains (say, 15 unique numbers from 1 to 10), the generator will tell you it is impossible rather than silently cheating — because in a fair draw, it is impossible.
What "Random" Really Means (and Doesn't)
Human intuition about randomness is famously wrong, and understanding why will make you a better user of any random tool. The core misunderstanding: random does not mean evenly spread. If you generate ten numbers between 1 and 100 and get 4, 7, 9, 12 — a clump at the low end — your first instinct is that the generator is broken. It is not. True randomness produces clumps, streaks, and gaps all the time; a sequence that looked perfectly spaced out (10, 20, 30, 40...) would actually be suspicious, because real randomness never lines up that neatly.
This illusion causes real problems. Lottery players avoid "1, 2, 3, 4, 5, 6" because it "doesn't look random" — yet it has exactly the same probability as any other combination, and avoiding it only means sharing the jackpot with fewer people if it hits (nobody else picks it either). Coaches drawing teams "randomly" by hand unconsciously avoid putting the two best players together, which is not random at all — it is rigged by politeness. Whenever fairness matters, let the machine draw; human "randomness" is just bias wearing a disguise.
The second misunderstanding is the gambler's fallacy: the belief that past draws influence future ones. After five coin flips land heads, tails feels "due." It is not — the coin has no memory, and neither does this generator. Each number is drawn fresh, with the full range available every time (unless you chose no-duplicates, where the pool shrinks by design). Streaks are normal: in 100 coin flips, a run of six heads in a row is expected, not miraculous.
So how do you sanity-check a generator? Not by eyeballing one draw, but by volume: generate a few hundred numbers and look at the distribution. Each number should appear roughly equally often, with the natural wobble that randomness produces. The statistics panel under the generator shows the sum and average of your draws — for large samples from 1 to 100, the average should hover near 50.5. Small samples bounce around; large samples settle down. That settling is the law of large numbers, and it is the only honest test of fairness there is.
Worked Example: Drawing a Raffle Winner
The setup: A school PTA sold 250 raffle tickets, numbered 1 to 250, for a fundraiser. Tonight, in front of the audience, they need to draw 3 winners — first, second, and third prize — and every ticket must have an equal chance. No ticket can win twice.
Step 1 — Set the range. Min: 1, Max: 250. This maps exactly onto the ticket numbers — no conversion, no off-by-one mistakes.
Step 2 — Set the count and duplicates. Count: 3, duplicates: off. Each ticket leaves the pool once drawn, exactly like pulling paper slips from a drum.
Step 3 — Draw, live. The organizer projects the screen and presses Generate in front of everyone. Result: 142, 37, 208. Ticket 142 wins first prize, 37 wins second, 208 wins third.
Step 4 — Verify fairness on the spot. Anyone in the room can see the settings: range 1–250, three numbers, no duplicates. There is nothing to trust and no hands inside a drum — the fairness is visible in the configuration itself. The draw history below the generator keeps a timestamped record of exactly what was drawn, which settles any dispute later.
Why not just pull names from a hat? For 250 tickets, a physical drum works — but it is slow, the mixing is never truly thorough (tickets at the bottom stay at the bottom), and nobody can verify the mixing was fair. The digital draw is instant, provably uniform, and witnessed by the whole room at once. For larger draws — thousands of contest entries, employee prize drawings — the physical approach stops being practical long before the digital one breaks a sweat.
Common Random Number Mistakes
- Using "looks random" as a test. Rejecting a draw because the numbers clumped together, then re-drawing until it "looks right." Re-drawing until you like the result destroys fairness — the first draw was the fair one.
- Drawing names by hand and calling it random. Humans cannot produce random sequences; we avoid repeats, favor middle values, and unconsciously protect people we like. Any draw that matters should be machine-generated.
- Forgetting that "no duplicates" shrinks the pool. Drawing 5 unique winners from 200 entries, then drawing "one more" from the same settings without resetting, can re-select an earlier winner if the history is not considered. Always check whether your new draw should exclude previous winners.
- Off-by-one range errors. "A number from 1 to 10" has ten possibilities; "0 to 10" has eleven. When mapping numbers onto real things (dice, cards, ticket ranges), count the endpoints carefully — an extra or missing value silently rigs the draw.
- Using random draws for decisions that need criteria. Randomness is for fairness, not for judgment. "Pick a random employee for the bonus" is unfair to top performers; "pick a random order to present" is perfectly fair. Match the tool to the problem.
- Re-rolling until you get the answer you wanted. Rolling a die "to decide" and then rolling again because you disliked the outcome is not decision-making — it is procrastination with extra steps. Commit to honoring the first result before you roll.
Tips: Everyday Uses for Random Numbers
- Classroom cold-calling. Number your students 1–30 and draw a number to pick who answers. It keeps everyone alert, feels fair, and ends debates about favoritism.
- Secret Santa and gift exchanges. Draw unique numbers 1–N and assign them to participants in a shuffled order — no slips of paper, no peeking, no "I swear I drew fairly."
- Workout variety. Number your exercises 1–12 and draw 5 for today's circuit. Random selection breaks routine and stops you from always skipping leg day.
- Decision tie-breaking. Two restaurants, both fine, nobody can decide? Assign 1–50 to one and 51–100 to the other; highest draw wins. The point is not the outcome — it is ending the debate in ten seconds.
- Sampling for quality checks. Inspecting every item in a batch of 500 is wasteful; drawing 20 random serial numbers for spot-checks gives a defensible, unbiased sample. This is genuine statistics, and it is how real quality control works.
- Creative prompts. Writers draw random page numbers, artists draw random color palette indices, musicians draw random chord numbers. Constraints chosen randomly are one of the oldest creativity tricks in existence.
- Password-adjacent uses (with care). Random numbers are great for PINs and short codes. For actual passwords, use a dedicated password manager — length and character variety matter more than the draw method.
Random numbers sit at a strange intersection: mathematically simple, psychologically tricky, and socially powerful. A fair draw resolves arguments, distributes luck, and creates trust — but only if the process is visibly fair and honestly random. Set the range, set the rules, press the button once, and honor the result. Everything else is ceremony.
My saved numbers reuse them in any calculator
Save a number once — like your rent or hourly rate — then just type its name instead of the number, in any calculator here. You can also type formulas like 5000 * 1.1 right into any box.
Saved only in this browser — nothing is sent to us.
Frequently Asked Questions
Is this random number generator truly random?
It uses your browser’s built-in cryptographic random generator (crypto.getRandomValues) — the same source of randomness used for security keys. That is far stronger than the basic Math.random() many online generators rely on.
What does “allow duplicates” do?
With duplicates off, every number appears at most once — like drawing names from a hat. Turn it on and numbers can repeat, which is what you want for dice-style rolls. If you ask for more unique numbers than the range holds, the tool will tell you to widen the range.
Can I generate random decimal numbers?
Yes — switch Number type to Decimals and set how many decimal places you want (0–10). Every value with that precision between your min and max is equally likely.
Are my numbers private?
Completely. Everything happens in your browser: no accounts, no uploads, no servers. Your settings and recent draws are saved only in your own browser’s local storage.