Random Number Generator
Distribution of results
Uniformity test
Draw more numbers in a narrower range to run the test.
Recent draws
Saved presets
How does the Random Number Generator work?
The generator gives you two sources of randomness, and you choose which one fits the job.
Secure random draws entropy from your operating system through the Web Crypto API (crypto.getRandomValues()). It is designed to be unpredictable. A new draw can still happen to repeat earlier values; the source alone does not prove that the entire draw procedure was fair.
Seeded turns any text you type into a starting state for a deterministic generator (xoshiro128**). The same seed and settings produce the same numbers, so anyone can replay your draw and confirm you got what you say you got.
Both run entirely in your browser. No number ever reaches a server.
No modulo bias
Most simple generators map a random 32-bit value onto your range with value % range. When the range does not divide evenly into 2³², the lowest numbers come up slightly more often than the rest. Over thousands of draws it is measurable.
This generator uses rejection sampling instead: values that would fall into the uneven tail are thrown away and redrawn. For a uniform integer draw with equally weighted allowed values, the mapping avoids favouring particular values through modulo reduction. The built-in uniformity test can flag a deviation in a sample; passing it does not prove uniformity.
What the generator can do
Range
- Minimum and maximum — whole or decimal values within the supported bounds, including negative values
- How many numbers — from 1 up to 1,000,000 in one draw
- No repeats — each allowed value appears at most once within that draw
- Sort — draw order, ascending, or descending; sorting never touches the randomness
- Step — restrict results to multiples of a value, so only 0, 5, 10, 15 come up
- Exclude numbers — list values that must never be drawn
Mode
- Source of randomness — secure (Web Crypto) or seeded (reproducible)
- Seed — any text; the same seed and settings replay the same draw
- Distribution — uniform, normal (Gaussian), exponential, Poisson, triangular, binomial
- Weights — draw only listed valid numbers with positive weights, written as
number:weight; unlisted numbers are excluded - Dice notation —
3d6+2,d20,2d20kh1for advantage,4d6dl1for rolling stats
Output
- Separator — comma, space, semicolon, tab, new line, or anything you type
- Number system — decimal, binary, octal, hexadecimal, or base 36
- Pad with zeros — turn 7 into 007 for ticket or ID numbers
- Prefix and suffix — wrap every number in fixed text
- Template —
{n}is the number,{i}its position, souser{n}becomesuser42 - Copy as — plain text, CSV, JSON, or a Markdown table
Statistics
Every draw is summarised live: sum, mean, median, lowest, highest, standard deviation, plus how many results are even, odd, or prime. A histogram shows the shape of the distribution, and a chi-square test checks a sample for evidence of departure from uniformity. Passing does not prove that the source or selection procedure is fair.
History
This browser keeps the last 50 draws, saving only the first 100 values and the settings for each. Restoring a draw and exporting the history as JSON include only those saved values. Copy the full current result before drawing again if you need every value. You can also save named presets and move them with the history using JSON.
Keyboard
Press Space or R to draw again without reaching for the mouse.
Quick presets
| Preset | Range | Count | Usage |
|---|---|---|---|
| 🎲 Dice | 1–6 | 1 | Board games, deciding |
| 🪙 Coin | 0–1 | 1 | Heads or tails |
| 🎰 Lottery | 1–49 | 6 | Unique, sorted, like a real draw |
| 💯 1–100 | 1–100 | 1 | Percentages, A/B splits |
| 🔢 PIN | 0–9 | 4 | Four digits, repeats allowed |
Reproducible draws
Seeded mode exists for the moments when “trust me, it was random” is not enough.
Agree on the settings and an independent method of choosing the seed before the draw. Matching inputs let others reproduce the result, but a seed alone does not establish that it was selected impartially. For a certificate, compare its fingerprint with the commitment published beforehand; the verifier does not check that publication or the seed-selection process itself.
It is also how you make randomness repeatable in work that has to be checked: a sampling plan a colleague can rerun, a set of test fixtures that stays stable across a test suite, a classroom exercise where every student gets the same “random” data.
Choosing a distribution
Uniform gives every number in the range the same chance. It is what people usually mean by random, and it is the default.
The others cluster results around a value, which is what real-world quantities tend to do:
- Normal (Gaussian) — heights, measurement errors, test scores. Set a mean and a standard deviation.
- Exponential — waiting times between independent events.
- Poisson — counts of events in a fixed interval: arrivals per hour, defects per batch.
- Triangular — when you know the minimum, maximum, and most likely value but nothing else. Common in project estimates.
- Binomial — successes out of a fixed number of trials at a fixed probability.
Every distribution is clipped to the range you set, so a long Gaussian tail cannot escape your minimum and maximum.
For nonuniform distributions, generated values outside the chosen range are clipped to the nearest boundary. A narrow range can therefore accumulate values at its minimum or maximum, changing the displayed distribution.
Where random numbers get used
Games and entertainment
- Board games — dice rolls, turn order
- Tabletop RPGs —
4d6dl1for ability scores,2d20kh1for advantage - Giveaways — reproducible number selection when the participants, settings and seed-selection procedure are agreed in advance
- Quizzes — random question order
Statistics and science
- Sampling — drawing a sample from a population without repeats
- A/B testing — assigning participants to groups
- Monte Carlo simulation — estimating probability by repetition
- Bootstrapping — resampling to estimate uncertainty
Development
- Test data — large batches can use a background worker, with practical limits depending on device memory and performance
- Fixtures — seeded, so a failing test fails the same way twice
- Random IDs — with padding, prefixes, or a template
- Load testing — templated identifiers like
user{n}@example.com
True vs. pseudorandom numbers
Math.random() | crypto.getRandomValues() | Seeded (xoshiro128**) | |
|---|---|---|---|
| Type | Pseudorandom | Cryptographically secure | Pseudorandom, deterministic |
| Entropy source | Engine-chosen seed | System CSPRNG | Your seed text |
| Predictable? | Potentially | No | Yes, by design |
| Repeatable? | No | No | Always |
| Good for security | No | Yes | No |
| Good for statistics | Depends | Yes | Yes |
| Replays with published seed and settings | Not through this tool | No seed-based replay | Yes, with a compatible generator version |
Secure draws use Web Crypto. Automatically suggested seed text and history identifiers use Math.random(); seeded mode is not intended for generating secret keys. For impartial reproducible draws, agree on an independent seed-selection method rather than relying on a privately chosen seed.
Draws without repetition
With No repeats enabled, each number in the range appears at most once. Ideal for:
- Giveaways — nobody can win twice
- Permutations — shuffling a set of items
- Bingo — calling numbers that stay called
- Lottery — six distinct numbers from 1 to 49
Uniform integer draws without replacement use a partial shuffle of eligible values. Weighted and decimal modes use different selection paths. The tool checks whether the requested count is possible, and some constrained modes can stop when retry limits are reached. Runtime depends on range, count, exclusions and the selected mode.
Exporting results
Copy the numbers as plain text with any separator you like, as CSV for a spreadsheet, as JSON for code, or as a Markdown table for documentation. Very large draws stay in memory in full and copy in full, even though only the first couple of thousand are drawn on screen.
Frequently asked questions (FAQ)
Is the result truly random?
Secure mode uses Web Crypto randomness intended to be unpredictable. The selected distribution and settings determine the output; it is not always uniform. Seeded mode is deterministic and reproducible with the same seed and settings. A later draw can still repeat earlier values.How many numbers can I generate at once?
Up to 1,000,000. Large draws can be calculated in a background worker, and the screen shows the first 2,000 with a count of the rest — copying still gives you everything.Can I generate negative numbers?
Yes. Set a negative minimum, or use a range with both limits negative. Integer bounds must be safe JavaScript integers, and the tool rejects ranges that exceed its supported span.Does sorting affect randomness?
No. Numbers are drawn first and sorted afterwards. Sorting changes only the order you see them in.Will the same seed give the same numbers tomorrow?
The same seed and settings reproduce the sequence with the same generator implementation. An algorithm change in a future version could change it, so retain the certificate and relevant settings when reproducibility matters.What does the uniformity test tell me?
It runs a chi-square test comparing how often each number actually came up against how often it should have. If the statistic stays below the critical value, the results are consistent with a uniform distribution. It needs a suitable number of categories and enough observations. A passing test is consistent with uniformity; it does not prove uniformity or an impartial draw procedure.How do weights work?
Write them asnumber:weight pairs, for example 1:5, 2:1, 3:1. Here 1 is five times as likely as 2 or 3. Numbers you do not list get a weight of zero and are never drawn.
What dice notation is supported?
3d6 rolls three six-sided dice. Add a modifier with 3d6+2. Keep or drop dice with kh, kl, dh, dl — so 2d20kh1 keeps the highest of two d20s (advantage) and 4d6dl1 drops the lowest of four d6s.
Is my history stored anywhere?
Only in this browser, in local storage. It never reaches a server, never syncs to another device, and disappears if you clear your site data. Export it to JSON if you want to keep or move it.Check an exported draw certificate with the draw verifier.