Random number generator

Pick a range and get truly unpredictable numbers for draws, games, samples and decisions.

Tier 0 · browser · unlimited
Random numbers
 

Fair random numbers

Draws, raffles, classroom picks, random samples for research and tabletop games all need numbers that nobody can predict or bias. This generator uses crypto.getRandomValues, the cryptographic random generator built into every modern browser, the same source used to create encryption keys.

It also avoids a subtle bias found in many simple generators: taking a random number "modulo 6" makes some outcomes slightly more likely. Here every number in your range has exactly the same chance.

Options

  • Range: minimum and maximum, both included.
  • How many: up to 1,000 numbers at once.
  • No repeats: each number appears at most once, like drawing tickets from a hat; 6 numbers from 1–60 simulates a Mega-Sena ticket.
  • Decimals: random values like 3.47 between 0 and 10.

Worked example

A raffle with 250 tickets: set 1 to 250, count 3, no repeats, and you get three different winning numbers.

How this works

For each number the page draws 32 random bits from the browser's cryptographic generator. If the range holds N values, it discards draws that would make some values more likely than others and keeps the rest, then maps the draw to your range. For decimals it draws on a grid of steps of 10 to the minus the number of decimals. In no-repeat mode, duplicates are redrawn. Numbers are generated in your browser when the page opens and every time you press Generate; nothing is sent or stored.

Frequently asked

Is this truly random?

It uses the browser's cryptographically secure generator, which is unpredictable for all practical purposes and suitable for draws and keys.

Can I avoid repeated numbers?

Yes, turn on No repeats. The range must contain at least as many numbers as you ask for.

Can I use it for a lottery or raffle?

Yes. For an official draw, record the settings and the result with a witness.

Are both ends of the range included?

Yes, min and max can both be drawn.

Sources

Reviewed Oct 17, 2026 · test vectors fixtures/calculators/math/random-number-generator/