Random Number Generator
Generate a single random integer, or a whole list of integers or decimals between any two limits. Uses your browser's cryptographic random source when available.
Simple Random Integer
Comprehensive Generator
What is a random number?
A random number is a value drawn from some range where every possible outcome has a known chance of appearing and there is no way to predict the next value from the previous ones. Rolling a fair six-sided die is the classic example — each face has a one-in-six chance and knowing the last roll tells you nothing about the next.
Random number generator, piece by piece
Each card explains one control on the generator above — how the range is mapped, how the "no repeats" option works, and why the histogram flattens out as you draw more samples.
Range mapping — from [0, 1) to your min/max
Every draw starts as a real number u in [0, 1) from the browser's generator. The calculator scales that into your chosen range: integers use floor(u·(max−min+1))+min so every whole value has an equal chance, and decimals use u·(max−min)+min rounded to the precision you pick.
No repeats — how the unique option works
When you tick "unique values" the calculator switches from independent draws to a shuffled sample. It builds the list of every integer in the range and does a Fisher–Yates shuffle, then takes the first n items — so you get n distinct values with no rejection loop, and asking for more values than the range holds is caught up front.
Distribution histogram — why the bars level out
The histogram under the results counts how many draws landed in each bucket. Because every outcome is equally likely, the expected height in each bin is the same; small runs look uneven, but as n grows the bars even out toward count / bins. Big spikes on a large run signal a configuration mistake, not a broken generator.
Worked example — mapping a uniform draw to a range
Pick a random integer between 1 and 100
Features of this calculator
- Custom minimum and maximum range
- Integer or decimal mode with configurable precision
- Generate a single value or a batch in one click
- Optional 'no duplicates' mode for lotteries and picks
- One-tap regenerate with the same settings
Frequently asked questions
+Is Math.random truly random?
No — it is a pseudo-random generator. The output is deterministic given the seed but unpredictable in practice for non-security uses.
+Can I get repeatable results?
Not with this tool. It uses fresh entropy on every draw. For reproducibility you need a seedable PRNG in code.
+Why not use this for passwords?
Statistical randomness ≠ cryptographic randomness. Use a library like crypto.getRandomValues directly, or a dedicated password generator.