Random · Numbers

Random number generator.

Pick fair random numbers in any range. Choose how many, block repeats, add decimal places, sort the list and copy it. Results come from your browser's secure random source.

Secure browser randomnessNo sign-upNothing stored or sentChecked 18 October 2026

Advertisement

Settings

Range
Output
1 to 10,000.

Result

Pick a range and press Generate.

How the random number generator works

Set a minimum and a maximum (both can be negative, and both are included), choose how many numbers you want, and press Generate. The count can be up to 10,000. Turn on No repeats to get a set of different numbers, like drawing numbered balls without putting them back. With repeats allowed, every draw is independent, so the same number can come up twice in a row.

Worked example. Range 1 to 6 with one number is a fair six-sided die. Range 1 to 49 with six numbers and No repeats gives six different numbers, the shape of a typical lottery pick. Range 0 to 1 with 2 decimal places gives values such as 0.37 or 0.82.

Pseudo-random vs cryptographically secure random

A pseudo-random number generator (PRNG) is a formula that stretches a small starting value, the seed, into a long run of numbers that look random. The JavaScript function Math.random() is a PRNG, and MDN warns that it does not provide cryptographically secure numbers and must not be used for anything related to security. A cryptographically secure PRNG (CSPRNG) is built so that nobody can work out earlier or later output from what they have seen, and the W3C Web Cryptography API says its seed is chosen by the browser and cannot be chosen or reset by the page. Browsers expose one as crypto.getRandomValues(), which MDN describes as returning cryptographically strong random values. NIST SP 800-90A specifies mechanisms for generating random bits with deterministic methods.

This page uses crypto.getRandomValues() only. It never calls Math.random(). For a dice roll or a classroom draw the difference does not matter, but it costs nothing and rules out predictable patterns.

Why the numbers are unbiased

A common shortcut maps a random 32-bit value into a range with a remainder (x % n). That slightly favours the low numbers unless the range divides 232 evenly. This tool uses rejection sampling instead: it throws away the few raw values that would cause the imbalance and draws again, so every number in your range is equally likely. For No repeats it uses Floyd’s sampling algorithm, so a huge range such as 0 to 1,000,000,000,000 is as fast as a small one, and then shuffles the picks with a Fisher-Yates shuffle so the order is random too.

Repeats and the birthday effect

People expect random numbers to avoid repeats, but they do not. With repeats allowed, the chance that a batch contains at least one repeat is the birthday-problem calculation: 1 minus (N × (N−1) × … ) divided by Nk. Draw 23 numbers from 365 possibilities and the chance of a repeat is already about 50.7%. When you generate more than one number with repeats allowed, the result panel shows this chance for your range and quantity.

Decimals

For decimal output the tool draws a whole number between your scaled bounds and then places the decimal point, so 0.1 + 0.2 style floating-point drift cannot creep in. If a bound has more decimal places than you asked for, it is rounded inward: 0.001 to 0.019 with 2 places can only give 0.01.

Quick pages for common ranges: 1 to 10, 1 to 100 and 1 to 1000.

Frequently asked questions

Is this random number generator truly random?

It is cryptographically secure pseudo-random, not physically random. The numbers come from crypto.getRandomValues(), the browser's secure generator, whose seed is chosen by the browser and cannot be chosen or reset by the page.

What is the difference between PRNG and CSPRNG?

A PRNG such as Math.random() is a fast formula whose output can in principle be predicted if its internal state is known. A CSPRNG is designed so that output cannot be predicted from earlier output. Use a CSPRNG for anything where predictability matters. This tool uses one.

How do I generate random numbers with no repeats?

Turn on "No repeats". The tool then picks different numbers from your range, and it tells you if you ask for more numbers than the range holds, for example 11 different numbers from 1 to 10.

Can I generate random decimals?

Yes. Choose 1 to 6 decimal places. The tool picks a whole number in the scaled range and places the decimal point, so results such as 0.37 are exact and never carry floating-point noise.

Why did I get the same number twice?

With repeats allowed, each draw is independent, so repeats are normal. Ten draws from 1 to 100 contain at least one repeat about 37% of the time. Turn on "No repeats" if you need distinct numbers.

Is the number I generate stored or sent anywhere?

No. Generation happens in your browser. The history list on this page lives only in memory and disappears when you close or reload the page.

Can I use it for a giveaway or lottery draw?

It is fine for informal draws, classroom picks and games. It is not an audited or certified draw, so for regulated contests follow the rules that apply to you.

Sources

Checked

Method notes: MDN describes crypto.getRandomValues() as returning cryptographically strong random values and says Math.random() does not provide cryptographically secure numbers. The W3C Web Cryptography API says the implementation, not the page, selects the seed. Range mapping uses rejection sampling and the Fisher-Yates shuffle, and both are unit-tested. Birthday-problem figures follow the standard formula and are unit-tested (23 from 365 gives 50.73%). Everything runs in your browser. Nothing you enter or generate is sent anywhere or stored.

Scope

A general-purpose random tool for games, classrooms, sampling and everyday choices. It is not an audited lottery draw. For regulated contests, gaming or legal selections, follow the rules that apply to you.

Advertisement
Advertisement