About Random Number Generators
A random number generator (RNG) produces values that cannot be predicted in advance. Software random number generators use a mathematical algorithm that starts from a seed value and produces a long, statistically random sequence. In the browser this is Math.random(), seeded by the operating system at page load β different every time you open the page.
This tool wraps that generator in a flexible interface: pick a range, choose integer or decimal output, generate one or many, deduplicate, sort, and copy or export. Everything runs locally.
Integer vs decimal mode
| Mode | Output | Example |
|---|---|---|
| Integer | Whole numbers only | 1, 7, 42, 128, 999 |
| Decimal | Numbers with fractional parts | 3.14, 0.782, 99.5 |
Decimal mode has a precision setting that controls how many digits appear after the decimal point. Two decimals for money-like values, four for statistical output, zero for a smoother-looking integer. The underlying distribution is uniform either way.
Inclusive range
Both bounds are inclusive. Asking for a random number between 1 and 6 gives you 1, 2, 3, 4, 5 or 6 β each with a 1-in-6 chance. This is the natural convention for dice, lottery numbers and everyday randomisation.
If you need a zero-based range for programming, use 0 to N-1.
Unique vs non-unique
By default, a batch can contain repeats β the same way rolling a die twice can give 4 and then 4 again. Enable Unique values only when you need distinct numbers, for example:
- Lottery number draws (6 unique numbers from 1β49)
- Sampling without replacement from a list
- Shuffling seat numbers or quiz questions
- Unique PINs or codes for a batch of items
Uniqueness requires the range to contain at least as many possible values as the quantity requested. If you ask for 100 unique integers between 1 and 50, the tool will warn you β the request is impossible.
Common use cases
Games & dice rolls
Simulate dice, cards, spins or prize draws.
Prize draws
Pick winning ticket numbers from a range.
Simulation
Generate input data for statistical models.
Test data
Create random IDs and sample inputs for tests.
Random sampling
Pick unique items from a set or list.
Teaching
Demonstrate probability and distribution.
How random is "random"?
JavaScript's Math.random() is a pseudo-random number generator (PRNG). Given the same seed, it will produce the same sequence β but in practice the seed changes with every page load, and the statistical properties are indistinguishable from true randomness for everyday use. The distribution is uniform across the range and there is no detectable pattern.
For cryptographic purposes (passwords, keys, security tokens), a true cryptographically secure PRNG is required β the browser exposes this through crypto.getRandomValues(). For lotteries, games, sampling and simulation, this tool is more than sufficient.
Privacy
This random number generator runs entirely in your browser. All generation happens locally using Math.random(). Your ranges, batches and history stay on your device β nothing is transmitted, stored or logged on any server.