Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Random number generator

Pick fair random numbers between any two values. Choose how many, whether they can repeat, and the order.

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Playing a game? The dice roller rolls any dice with the odds of each total. Need a secure code instead? Use the password generator.

How the numbers are picked

Each number comes from your browser's cryptographic random generator (crypto.getRandomValues), the same source used for security keys. It's not a simple Math.random().

To make every number equally likely, the generator uses rejection sampling. It draws a random 32-bit value, and if that value falls in the small leftover zone that doesn't divide evenly by the size of your range, it throws it away and draws again.

limit = ⌊2³² ÷ n⌋ × n; draw x until x < limit; result = lowest + (x mod n)

Here n is how many values are possible. Without this step, a quick x mod n would make some numbers very slightly more likely than others. This is called modulo bias.

Worked example

From 1 to 6 there are n = 6 values. ⌊4,294,967,296 ÷ 6⌋ × 6 = 4,294,967,292, so the top 4 of the 4.29 billion possible draws are thrown away. Every face then has exactly the same chance, 1 in 6.

Decimals work the same way on a grid. 0 to 1 with 2 decimal places means the 101 values 0.00, 0.01, … 1.00, each equally likely.

No repeats

With repeats turned off, it's like drawing numbered tickets from a hat without putting them back. You can't ask for more numbers than the range holds. For example, 1 to 10 has only 10 different numbers.

Limitations

  • Up to 10,000 numbers at a time, within ±9,007,199,254,740,991 (the largest whole number JavaScript stores exactly).
  • Good for raffles, games, classroom picks and sampling. For an official lottery or a legal drawing, follow the rules that apply to it, which may require a certified process.
  • Nothing is saved. Each click of Generate makes a fresh draw.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • Edge: a range of 5 to 5 always gives 5 ✓
  • 3 numbers from 1 to 3 with no repeats, sorted: 1, 2, 3 ✓
  • 4 numbers from 1 to 3 with no repeats is impossible ✓
  • 0 to 1 with 2 decimal places has 101 possible values ✓
  • Endpoints with 13 digits are exact: 1 to 1,234,567,890,123 ✓
  • 15-digit range 123456789012345 to …349 holds 5 numbers, no repeats ✓
  • Edge: a count of 2.5 asks for a whole number ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

Is this random number generator truly random?

It uses your device's cryptographically secure generator, which is designed to be unpredictable. It's suitable for games, raffles and sampling.

How do I pick random numbers with no repeats?

Set Repeats to "No repeats". Each number is then used at most once, like drawing tickets from a hat.

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

Set Lowest to 1 and Highest to 10, then press Generate. Both ends are included, so 1 and 10 can come up.

Can I generate random decimals?

Yes. Choose Decimals and set how many decimal places you want. Every value on that grid is equally likely.

Related calculators