ToolNest

Random Number Generator

Free random number generator. Pick cryptographically random numbers in any range, with options for multiple numbers and no repeats.

Numbers come from crypto.getRandomValues() — cryptographically secure randomness, generated on your device.

This generator uses your browser’s Web Crypto API — the same cryptographically secure source used for encryption keys — rather than the ordinary pseudo-random function most sites rely on. That makes the output suitable for giveaways, prize draws and any situation where the fairness of the result matters.

Set a range, choose how many numbers you want, and decide whether repeats are allowed. Everything runs locally on your device.

How to use the Random Number Generator

  1. Set the minimum and maximum

    Both ends are included in the range, so 1 to 100 can return 1 and 100.

  2. Choose how many numbers

    Generate a single number or a batch — useful for drawing multiple winners at once.

  3. Decide on repeats

    Turn off duplicates when drawing distinct winners; leave them on to simulate dice or independent trials.

  4. Generate and copy

    Results appear instantly and can be copied with one click for your records.

True random versus pseudo-random

Most software random numbers are pseudo-random: an algorithm produces a sequence that looks random but is fully determined by a starting seed. Given the seed, every subsequent number is predictable.

Cryptographically secure generators — crypto.getRandomValues() in the browser — draw entropy from unpredictable physical sources the operating system collects, such as interrupt timings and hardware noise. The output cannot be predicted even by someone who knows the algorithm.

For a dice roll in a game, the difference is irrelevant. For a public prize draw or anything a person could gain from predicting, it matters a great deal — which is why this tool uses the secure source.

Avoiding modulo bias

The obvious way to constrain a random number to a range — take the remainder after dividing — introduces a subtle unfairness. If the underlying generator produces 0 to 255 and you want 1 to 10, the first six values occur slightly more often than the rest, because 256 does not divide evenly by 10.

The correct technique is rejection sampling: discard values that fall in the uneven tail and draw again. This tool does that, so every number in your range is genuinely equally likely.

Common uses

  • Giveaways and prize draws — number your entrants and draw without repeats. Screen-record the draw if you need to demonstrate fairness.
  • Classroom selection — pick a student number without unconscious bias toward the same few hands.
  • Simulated dice and cards — set 1–6 or 1–52 with repeats enabled.
  • Sampling for audits and research — select random rows from a numbered dataset.
  • Sports and team assignment — randomise draft order or split a group into teams.

The gambler’s fallacy

A fair generator has no memory. If you draw five odd numbers in a row, the next draw is exactly as likely to be odd as it was the first time. Believing otherwise — that a result is "due" — is the gambler’s fallacy, and it costs people money constantly.

Genuinely random sequences also contain more clustering than intuition expects. Long runs of the same result are normal in random data, and a sequence that looks "too even" is usually the suspicious one.

Frequently asked questions

Are these numbers truly random?

They come from the browser’s cryptographically secure generator, which draws on operating-system entropy from unpredictable physical sources. That is far stronger than a standard pseudo-random function and is suitable for prize draws.

Can I generate numbers without duplicates?

Yes — turn off repeats and every number drawn will be distinct. This is the setting to use when picking multiple winners.

Is the range inclusive?

Yes. Setting 1 to 100 means both 1 and 100 can be returned.

Can I use this for a giveaway?

Yes. Number your entrants sequentially, set the range to match, disable repeats and draw. Recording your screen provides evidence the draw was not repeated until a favourable result appeared.

What is modulo bias?

A subtle unfairness that appears when a large random range is squeezed into a smaller one using a remainder operation, making low numbers slightly more likely. This tool uses rejection sampling to avoid it.

Does the same seed give the same numbers?

No. Cryptographically secure generation is not seedable, so results cannot be reproduced or predicted — which is precisely the point.

Can I generate decimals?

This tool produces whole numbers. For decimals, generate an integer over a larger range and divide — for two decimal places between 0 and 1, draw 0–100 and divide by 100.

Are the results sent anywhere?

No. Generation happens entirely in your browser and nothing is transmitted or logged.

100% private. Files are processed on your device and never uploaded.

Instant results. No upload queue. Processing time depends on your device.

Free forever. No signup, no watermark, no paid tier.

Works everywhere. Use a modern browser on your phone or computer.

Related tools

Random Number Generator is one of all the free tools on ToolNest. No account or subscription needed — anywhere in the world.