Skip to content
SmaftyTools

Random Number Generator

Generate random numbers in any range, with optional no-repeat and cryptographically secure modes. Free online random number generator.

About Random Number Generator

The Random Number Generator produces one or many random integers within any range you choose, with two extra controls most simple generators skip: a "no repeats" mode that draws numbers without replacement, and a cryptographically secure mode that pulls from the Web Crypto API's random number source instead of `Math.random()`. Set a minimum, maximum and how many numbers you want, toggle the options that matter, and click Generate — the result appears instantly with a one-click copy button. Whether you need a random number picker for a quick decision, want to generate random numbers in bulk for test data, or are looking for a true random number source you can trust, this covers all three cases in one tool.

The distinction between the two modes matters for different use cases. `Math.random()` is fast and statistically fine for games, raffles, sampling and everyday randomness, but it isn't specified to be cryptographically unpredictable — a determined attacker could theoretically model or predict its output in some JavaScript engines. The "cryptographically secure" mode instead uses `crypto.getRandomValues()`, the same underlying source browsers use for generating encryption keys, with rejection sampling applied so the result stays perfectly uniform across your chosen range (avoiding the subtle bias a naive modulo operation would introduce).

"No repeats" mode is a genuinely different algorithm, not just a filter: it performs a partial Fisher-Yates shuffle over every possible value in your range and takes the first N, which guarantees no duplicates and keeps every possible number equally likely to appear (unlike naively re-rolling on collision, which subtly skews probabilities). This is exactly what you want for raffle drawings, choosing multiple unique winners, or dealing out unique reference numbers — set min/max to your range, count to how many you need, and no repeats on.

Common uses span lottery number generation, picking a random participant identifier, generating test data, settling a decision with an unbiased number, and classroom or game-night activities. Every number is generated locally in your browser — nothing about your range, count or the results themselves is ever sent anywhere.

How to Use the Random Number Generator

  1. Enter a minimum and maximum value, and how many numbers you want.
  2. Turn on "No repeats" for unique values, or "Cryptographically secure" for Web Crypto-backed randomness.
  3. Click Generate, then Copy to copy the results as a comma-separated list.

Features

  • Any integer range, positive or negative
  • Generate up to 10,000 numbers at once
  • No-repeat mode via unbiased partial Fisher-Yates shuffling
  • Optional cryptographically secure mode via the Web Crypto API

Examples

Picking a single lottery-style number

Input

Min 1, Max 49, count 1

Output

A single random number between 1 and 49, e.g. 27

Drawing 5 unique raffle winners from 100 tickets

Input

Min 1, Max 100, count 5, No repeats on

Output

5 distinct numbers between 1 and 100, e.g. 4, 88, 15, 62, 31

Frequently Asked Questions

What's the difference between the normal and secure modes?

Normal mode uses JavaScript's built-in Math.random(), which is fast and fine for games and everyday randomness. Secure mode uses the Web Crypto API's crypto.getRandomValues() — the same source used for encryption keys — for cases where unpredictability actually matters.

How does "no repeats" avoid bias toward earlier numbers?

It uses a partial Fisher-Yates shuffle over the full range rather than repeatedly rolling and discarding duplicates, which keeps every remaining number equally likely to be picked at each step — a mathematically unbiased way to sample without replacement.

What happens if I ask for more unique numbers than fit in my range?

With "no repeats" on, the result is capped at the size of your range — for example, asking for 20 unique numbers between 1 and 10 returns all 10 possible values.

Is the Random Number Generator free?

Yes, the Random Number Generator is completely free with no usage limits. No signup, no account and no installation required.

Does the Random Number Generator work on mobile?

Yes. The Random Number Generator is fully responsive and works in any modern browser on phones, tablets and desktops.