Random Number Generator
Generate truly random numbers in any range. Dice presets, bulk generation, and instant results — all inside your browser.
🔐 True Randomness
Uses crypto.getRandomValues() — a cryptographically secure source, not the predictable Math.random().
🎲 Uniform Distribution
Every number in your range has an exactly equal probability of being chosen. No bias, no patterns.
🔒 100% Private
Nothing is sent anywhere. All generation happens locally in your browser. Zero tracking, zero logs.
Common Use Cases
- Giveaways & raffles. Set the range to your participant count (e.g., 1–500) and generate one number for the winner. Record the timestamp and range for transparency.
- Dice games & tabletop. Use the D6, D10, D20, or D100 presets. Roll multiple dice by setting count > 1.
- Lottery number picking. The "6 of 49" preset matches many national lotteries; adjust min/max/count for other formats.
- Random sampling for research. Generate indices to sample rows from a dataset without bias.
- Seating charts & team assignment. Generate a random permutation by drawing unique numbers equal to the group size.
- Testing & QA. Feed randomised inputs to your code to surface edge cases.
Understanding Bias & How to Avoid It
Even a perfectly uniform random generator can produce biased results if you use it wrong. Here are the common pitfalls:
- Modulo bias. If you take a random 32-bit integer and do
% 100, numbers 0–58 appear slightly more often than 59–99 because 2³² is not a multiple of 100. This tool uses rejection sampling to eliminate modulo bias entirely — every output is exactly equally likely. - Drawing without replacement. If you need 6 unique lottery numbers, generate them in one bulk draw (count=6) rather than clicking Generate six times. The bulk mode samples without replacement automatically; repeated single draws could repeat a number.
- Range mistakes. Make sure your range matches the real pool. A raffle with tickets numbered 100–599 has 500 entries, not 499 — set min=100, max=599.
- Human bias in interpreting results. People often re-roll if a result "feels wrong" (too high, too low, patterns like 777). Don't. Every outcome of a fair generator is equally valid.
Transparency for Public Draws
If you're running a public giveaway or selection where trust matters:
- Announce the exact range and count before generating.
- Screenshot or screen-record the generation with the visible URL and parameters.
- Publish the result immediately; don't generate multiple times and pick the one you like.
- For high-stakes draws, consider a deterministic commitment scheme (hash the future result, publish the hash, then reveal).
Frequently Asked Questions
Is this truly random?
Yes. This tool uses crypto.getRandomValues(), a cryptographically secure pseudo-random number generator built into every modern browser. It is far superior to Math.random(), which is not cryptographically secure.
What is the maximum range I can use?
You can enter any integer values for min and max. For very large ranges (above 2³²), the unbiased rejection-sampling algorithm used here ensures perfectly uniform distribution with no modulo bias.
Can I generate lottery numbers?
Yes — use the "6 of 49" preset to generate 6 unique numbers between 1 and 49, matching standard lottery formats. You can also set a custom range and count to match any lottery format worldwide.
What does "bulk mode" do?
Setting the count above 1 generates multiple independent random numbers in a single click. Each number is independently sampled from the same range with equal probability.
How to use the Random Number Generator
- Set the minimum and maximum. Both bounds are inclusive, so a range of 1 to 6 can produce 1, 2, 3, 4, 5, or 6 — exactly like a die. You can type any integer values; the tool stays uniform even for very large ranges.
- Choose how many numbers you need. The count field generates up to 100 independent numbers at once, each drawn separately from the same range. Use this for a set of lottery numbers, a seating chart draw, or multiple dice in one roll.
- Use a preset for common cases. The quick buttons cover a standard die (D6), D10, D20, percentile (D100), a 6-of-49 lottery draw, a single byte (0–255), and a one-in-a-million pick. Clicking a preset fills the range and rolls immediately.
- Click Generate — or press Enter. The result appears in large type; with multiple numbers each one is shown in its own chip so you can read them at a glance. Every generation is independent, so repeat rolls stay fair.
- Copy the result if you need it. The Copy button places the number (or comma-separated list) on your clipboard, ready for a message, a spreadsheet, or a record of the draw.
- Check the history. The last ten results are kept in the panel below, so you can review a session's draws — useful for verifying a sequence of rolls or picks.
Why the random source matters
Not all random numbers are equal. Math.random(), the everyday generator most web apps use, is a deterministic pseudo-random number generator: it produces numbers that look scattered but are computed from a small internal state. If an observer knows that state — and it is often recoverable from a handful of outputs — every future "random" number becomes predictable. For a dice game or a test fixture that is usually harmless. For a giveaway, a password, a cryptographic key, or anything an attacker would love to predict, it is a genuine vulnerability.
This tool therefore uses crypto.getRandomValues(), the same cryptographically secure pseudo-random number generator (CSPRNG) that operating systems use to generate encryption keys. It is seeded from genuine entropy gathered on your device — hardware noise, timing jitter, system events — and its output is designed so that knowing past numbers gives no information about future ones. To that standard, "random" and "unpredictable" are effectively the same word.
Two practical notes. First, every result here is independent: rolling a die that lands on 6 does not make 6 any less likely next time, and the tool never carries state between generations that could skew a distribution. Second, avoid bias in your own use — when you draw without replacement (like lottery numbers), generate them in one bulk draw so each pick removes a number from the pool exactly once. Randomness is only fair when the sampling method is sound, and that is true in the tool, in the browser, and in how you use the output.