Random Number Generator
Generate random integers or decimals within any range. Generate single or multiple numbers at once.
Quick Presets
Settings
🔐 Using window.crypto.getRandomValues() — cryptographically secure · All calculations run locally in your browser.
What Is the Random Number Generator?
A random number generator samples values from a probability distribution over a specified range. Uniform distributions give every value equal probability. Normal (Gaussian) distributions cluster around a mean, modeling natural phenomena. Exponential distributions model time between independent events. All generation uses the browser's cryptographically secure crypto.getRandomValues() API.
Formula
How to Use
Choose a preset (D6, D20, Coin, etc.) or enter a custom min and max. Set how many numbers to generate. Pick Integer or Decimal mode. For reproducible results, expand Advanced Options and enable Seeded mode with a custom seed. To visualise the distribution, generate 50+ numbers — a histogram appears automatically.
Example Calculation
Roll a D20: select the D20 preset and click Generate. For a normal distribution around 50 (σ=10): enter min=0, max=100, expand Advanced, choose Normal distribution, set Mean=50 and Std Dev=10, generate 500 numbers, and inspect the bell-curve histogram.
Understanding Random Number Generator
Our advanced random number generator uses your browser's built-in cryptographically secure API (crypto.getRandomValues) to produce high-quality random numbers — no Math.random() shortcuts.
Choose from three distributions: Uniform (equal probability across the range), Normal/Gaussian (bell-curve centred on a mean), and Exponential (ideal for modelling inter-event times). Each distribution includes explanatory tooltips so you understand exactly what you're generating.
For reproducible experiments, enable seeded mode and enter any seed string. The Mulberry32 PRNG ensures the same seed always produces the same sequence — essential for peer-reviewable simulations and unit tests.
Generate a single number (dice roll, coin flip) or up to 10,000 at once. When generating 10 or more numbers, a frequency histogram appears automatically showing the distribution shape. Summary statistics (min, max, mean, median, standard deviation) help you verify the generation is behaving as expected.
Results can be copied to the clipboard, exported as CSV, or downloaded as JSON — including all generation parameters for full reproducibility. The history panel keeps your last 10 generations visible so you can compare runs or restore a previous set.
All calculations run entirely in your browser. No data is sent to any server.
Frequently Asked Questions
Is this cryptographically secure?
Yes — by default this tool uses window.crypto.getRandomValues(), which is cryptographically secure (CSPRNG). It is suitable for generating passwords, tokens, and security-sensitive values. The seeded mode uses the Mulberry32 PRNG which is not cryptographically secure but is deterministic and high-quality for simulations.
What is the difference between the distributions?
Uniform: every value in [min, max] is equally likely — standard dice rolls, sampling. Normal (Gaussian): values cluster around a mean with standard deviation controlling the spread — models heights, test scores, measurement errors. Exponential: values cluster near the minimum with an exponential drop-off — models inter-arrival times, component lifetimes.
What does "unique values" mode do?
In unique mode, the same number will not appear twice in a single generation. This is equivalent to sampling without replacement — useful for lottery-style picks, random permutations, or selecting items from a list. Note: you cannot generate more unique integers than there are integers in the range.
What is seeded randomness?
A seeded PRNG produces the same sequence every time for the same seed value. This makes results reproducible — useful for scientific simulations, A/B testing, and debugging. Enter any text or number as the seed. The same seed always yields the same output.
How many numbers can I generate at once?
Up to 10,000 numbers per generation. For large batches, the tool shows a frequency distribution histogram and summary statistics (min, max, mean, median, standard deviation) instead of listing every number.
Can I export the results?
Yes — use the Copy button to copy all numbers to the clipboard as comma-separated values, or export as CSV (with index column) or JSON (includes generation parameters).
Related Tools
Dice Roller — Virtual Dice
Roll any number of dice with any number of sides. Supports D4, D6, D8, D10, D12,…
Coin Flip Simulator — Heads or Tails
Flip a virtual coin and track heads/tails statistics over multiple flips.…
Lottery Number Generator
Generate random lottery numbers for Powerball, Mega Millions, or custom number r…