Random Number Generator

Cryptographically strong random numbers in any range.

Free random number generator that produces cryptographically strong numbers in any range, with optional no-repeats mode. Runs entirely in your browser using the Web Crypto API — nothing is uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

Are these numbers truly random?

They use the browser's Web Crypto API (crypto.getRandomValues), which is a cryptographically strong random source. The tool also removes modulo bias so every value in your range is equally likely.

Generate one or many random numbers in any range you choose — for raffles, prize draws, lottery picks, sampling, dice and decisions. Numbers come from the browser’s Web Crypto API, a cryptographically strong source, with modulo bias removed so every value is equally likely.

From entropy to your range: what happens on each draw

You set a minimum, a maximum, and how many numbers you want. For each value the tool requests random bytes from crypto.getRandomValues and maps them into your range using rejection sampling: it discards any raw value that falls in the uneven top portion of the byte range and re-draws, which eliminates modulo bias and keeps every integer from min to max (inclusive) exactly equally likely.

With No repeats enabled, the tool draws unique values — effectively shuffling the range with an unbiased Fisher–Yates shuffle and taking the first N — so no number appears twice, provided the range is large enough to supply the count you asked for.

crypto.getRandomValues is defined by the W3C Web Cryptography specification, which requires implementations to seed it from “a source of entropy” strong enough for cryptographic use; the practical details are documented on MDN. Every modern browser implements it natively — there is no polyfill or fallback in this tool, so you always get the strong source.

Example

Range 1 to 50, count 6, No repeats on. A draw might be:

7 · 19 · 23 · 31 · 42 · 49

All six are distinct, suitable for a lottery-style pick. Turn No repeats off and the same number could appear more than once, like rolling the same value twice.

SettingMeaning
Min / MaxInclusive bounds of the range
CountHow many numbers to draw
No repeatsForces all results to be unique

Why “cryptographically strong” matters for fairness

Not all random number generators are equal. The Math.random() function available in JavaScript is a pseudo-random generator — it produces a deterministic sequence from a seed, which is fine for visual effects and game logic but is not suitable for anything where fairness matters, because in principle the sequence could be predicted or reconstructed.

crypto.getRandomValues uses the operating system’s entropy sources — hardware timing variations, I/O events, and other non-deterministic inputs — to produce values that cannot be predicted from the output sequence. This is what makes it appropriate for raffles, prize draws, and sampling tasks where the result must be defensibly fair to all participants.

The second piece of this tool’s approach — rejection sampling to remove modulo bias — matters because simply taking randomBytes mod N produces a subtly uneven distribution when the random range is not a perfect multiple of N. For small ranges the bias is tiny; for tasks where fairness is important it is worth removing entirely, which is what this tool does.

Repeats are normal: the birthday effect

When No repeats is off, duplicates appear far sooner than intuition suggests. This is the classic birthday problem: among just 23 people, the probability that two share a birthday already exceeds 50%, even though there are 365 possible days. The same mathematics applies to random draws — drawing 23 numbers from a range of 365 with repeats allowed gives you a better-than-even chance of at least one duplicate.

So if you draw 10 numbers between 1 and 100 and see the same value twice, the generator is not broken — that outcome has roughly a 37% chance of happening on any given draw. When duplicates would be a problem (raffle winners, sampled survey participants), switch No repeats on and the tool guarantees uniqueness instead of leaving it to chance.

Practical use cases

  • Raffle and prize draw: set Min 1, Max to the number of entrants, No repeats on, count 1 (or however many prizes exist). Each press draws a defensibly fair winner.
  • Lottery number pick: range 1–59 (or your lottery’s range), No repeats on, count 6. Reroll as many times as you like before buying a ticket.
  • Random sampling: draw a subset from a numbered list without replacement by setting No repeats on and the range to the size of your dataset.
  • Dice: set Min 1, Max to the number of faces (6, 8, 10, 12, 20, 100), count 1. No repeats is not meaningful for a single die, but useful if you want multiple distinct faces in one roll.

What this tool is not for

Honesty matters with randomness, so two boundaries are worth stating. First, this generator is not a substitute for an auditable draw where regulations require one — some jurisdictions require licensed lottery draws to use certified hardware and an audit trail. Second, while the underlying source is cryptographic quality, generating secrets (passwords, API keys, encryption keys) is better done with a tool designed for that job, which encodes the entropy into the right format and length — see the password generator on this site. For picking winners, sampling, shuffling and decisions, this is exactly the right tool.

Everything runs entirely in your browser — nothing is uploaded.