Math tool

Random Number Generator

Pick random numbers in any range, with or without repeats.

Who this is for: Raffles, random samples and picking a winner.

Calculated in your browser — the numbers you enter are never sent to our servers.

Pick a random number between any two limits, or draw many at once — with or without repeats, sorted or in the order drawn, as whole numbers or with decimals. Numbers come from your browser’s cryptographic generator with no modulo bias, so every value in the range is equally likely.

Best for: Raffles and giveaways, Picking a winner, Random samples, Games and classrooms

Updated September 2026 · Estimates only, not financial advice.

Every value in the range is equally likely — without the modulo bias

A fair generator gives each number in the range the same chance: between 1 and 100, each has exactly 1 in 100. The common shortcut of taking a random 32-bit number modulo the range size is almost fair but not quite. For a range of 10, 2^32 leaves a remainder of 6, so the digits 0 to 5 each have one more way to be chosen than 6 to 9 — a bias of about 1 in 429 million.

That is tiny, but there is no reason to accept it. This generator discards the raw values in the uneven tail and draws again (rejection sampling), and it combines two draws for ranges wider than four billion, so every value is exactly equally likely at any size.

Drawing 6 different numbers from 49, like a lottery

With No repeats ticked, each number can appear only once, as balls drawn from a drum. There are 13,983,816 ways to choose 6 numbers from 49, so any particular ticket has a 1 in 13,983,816 chance, and any one number has a 6 in 49 chance of being among those drawn.

The generator uses Floyd’s sampling algorithm, which picks exactly the requested number of distinct values with every combination equally likely, then shuffles them so the order is random too. If you ask for more different numbers than the range contains — 10 unique numbers from 1 to 5, say — it tells you instead of looping forever.

C(49, 6)

49 × 48 × 47 × 46 × 45 × 44 ÷ (6 × 5 × 4 × 3 × 2 × 1)

= 10,068,347,520 ÷ 720

= 13,983,816

Why the numbers come from crypto.getRandomValues, not Math.random

Most quick generators use Math.random, a fast pseudo-random function that is fine for animations but not designed to be unpredictable. The Web Crypto API’s getRandomValues draws from the operating system’s cryptographically secure source, the same kind used to create encryption keys, so the next number cannot be predicted from earlier ones.

Everything happens in your browser: the numbers are never sent to a server or stored, and each press of Generate makes a fresh draw.

Decimals: a range of 0 to 1 at two places has 101 possible values

In decimal mode you choose how many places to keep, and the generator draws uniformly from every value at that precision. From 0 to 1 at two decimal places there are 101 possible values — 0.00, 0.01 and so on up to 1.00 — each with the same chance.

Both limits are included, which matters for small ranges: 0 to 1 in whole numbers is a fair coin.

100,000 draws from 1 to 10 must pass a chi-square test before every release

Fairness is checked, not assumed. Before each release the generator’s formula suite draws 100,000 whole numbers from 1 to 10 and compares how often each value appeared with the 10,000 a perfectly even spread would give. The chi-square statistic that sums those gaps must stay below 16.919, the value a fair generator exceeds only 5% of the time with 9 degrees of freedom.

The same suite checks that no-repeat draws never repeat, that a full draw of 1 to 49 without repeats contains every number exactly once, that negative ranges and decimals stay inside their limits, and that the rejection step really discards the biased tail of raw values. If any check fails, the page does not ship.

Worked example

A lottery-style draw: 6 different numbers from 1 to 49.

Worked example

Possible combinations = 13,983,816

Chance of one ticket matching = 1 in 13,983,816

Chance a given number is drawn = 6 in 49, 12.24%

Limitations

  • Not a certified generator for regulated lotteries or legal draws.
  • Very large ranges at many decimal places are refused rather than rounded.

Frequently Asked Questions

How do I pick a random number between 1 and 10?

Set the lower limit to 1 and the upper to 10, or press the 1–10 preset. Each of the ten numbers has exactly a 10% chance.

Can it draw numbers without repeats?

Yes — tick No repeats. It is refused only if you ask for more different numbers than the range holds.

Sources & References

Figures on this page are checked against primary, authoritative sources. Links open in a new tab.

Related Calculators

ProbabilityTwo events, repeated trials and Bayes, with the three usual errors handled — the dropped overlap in P(A or B), n×p instead of the complement, and the base rate that makes a 99% test 17% right.
Dice RollerRoll any dice with a modifier, advantage or disadvantage, and see the exact probability of every total.
Sample SizeResponses needed for a target margin of error, with the finite-population correction and a table of the whole cost curve — because n scales with 1/margin², so the last point of precision costs more than the first ten.
Binomial Coefficientn choose k exactly on big integers, by the multiplicative formula that divides as it goes and never builds a factorial — with Pascal's rule and permutations beside it.
Uniform DistributionHandles the continuous and discrete uniform as the separate distributions they are — P(X = x) is zero in one and 1/n in the other, and the variances differ for identical endpoints.
Password GeneratorStrong random passwords made on your device, with the entropy in bits and how long brute force would take.
Standard DeviationSample and population standard deviation, plus variance, mean, median, quartiles, z-scores, outliers, and confidence intervals.
Cross-ValidationRun k-fold cross-validation over a penalty path and repeat it across twelve fold assignments, so the variability of the chosen tuning parameter is visible.

More in Math, or browse all calculators.

Note

This calculator is an educational tool. For graded coursework, exams, or professional work, double-check the method and rounding against your own requirements.

How we calculate · Found an error? email us

Authorship & verification

Built and maintained by .

What's changed (3 updates)

Published 22 September 2026

  1. Published a random number generator: any range, up to 10,000 numbers, no-repeat draws by Floyd’s algorithm, decimals, sorted output.
  2. Unbiased cryptographic draws with no modulo bias.
  3. Added an automated formula suite including a chi-square uniformity test.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.