ToolBook
Support us on Ko-fi
Help us keep this free, forever

Random Number Generator

How to use the Random Number Generator

Set your range, choose how many numbers you need, and click Generate.

  1. Enter the range

    Type your minimum and maximum values. The default range is 1 to 100; use any integers including negatives.

  2. Set the count

    Choose how many random numbers to generate (1–100). For a single pick, leave Count at 1.

  3. Toggle no repeats if needed

    Enable "no repeats" when you want each number to appear only once. Required for lotteries, card draws, or random sampling.

  4. Click Generate

    Results appear instantly. For bulk results, use Sort to reorder and Copy to copy all numbers to your clipboard.

  5. Read the histogram

    When generating multiple numbers, the frequency histogram shows how your results distribute across the range, giving a visual check on uniformity.

Frequently asked questions

Is this truly random or pseudo-random?

This tool uses the browser's built-in crypto.getRandomValues(), the same cryptographic random number generator used for password managers and security tokens. It produces cryptographically secure randomness, which is far stronger than Math.random() used by most other online tools.

What does the "no repeats" option do?

When "no repeats" is enabled, each number in the result is unique, like drawing numbered balls from a bag without replacement. When disabled, the same number can appear multiple times (like rolling a die). Unique mode requires the range (Max minus Min + 1) to be at least as large as the count.

How do I use this as a lottery number generator?

Set Min to 1, Max to the highest number in the lottery (e.g. 49 for a standard draw), Count to how many numbers you need (e.g. 6), and enable "no repeats". Each draw is cryptographically random and fully independent.

Can I generate a random number between 1 and 10?

Yes. Set Min to 1, Max to 10, Count to 1, and click Generate. You can use any range: 1–6 for a dice roll, 1–52 for a card draw, 1–1000 for a large sample. Negative ranges work too (e.g. Min -50, Max 50).

What does the histogram show?

When you generate more than one number, the histogram below your results shows the frequency distribution: how many of your numbers fell in each equal-width bucket across the range. A flat histogram means the results are spread evenly, as expected from a uniform random generator.

How do I sort or copy the generated numbers?

Use the Sort button (ascending, descending, or original order) to reorder the result list. Click Copy to copy all numbers to your clipboard as a comma-separated list, ready to paste into a spreadsheet or script.

What is the maximum quantity I can generate at once?

The tool generates up to 100 numbers per click. For larger batches, click Generate multiple times. Each click is fully independent and the results do not carry over from the previous draw.

Do decimal or floating-point numbers work?

This tool generates whole integers only. For a decimal result, generate an integer and shift it manually. To get a random number between 0.00 and 1.00, generate between 0 and 100 and divide by 100.

Is this tool free and does it store my inputs?

The tool is completely free. All generation happens locally in your browser using the Web Crypto API. No numbers, ranges, or results are sent to any server.

Random numbers: pseudo-random vs cryptographic, and why the difference matters

What makes a number generator truly random, how uniform distribution works, and the right tool for lotteries, sampling, and simulation.

Random numbers: what "random" actually means and why it matters

Not all random number generators are equal. The difference between Math.random() and crypto.getRandomValues() is the difference between a predictable sequence and a genuinely unpredictable one — and for anything security-sensitive, only the second is acceptable.

Pseudo-random vs cryptographically random

Math.random() (used in most simple tools) generates numbers using a deterministic algorithm seeded from the current time. If you know the seed and the algorithm, you can predict every future output. For games and simulations this is fine. For passwords, lotteries, or security tokens — it is not.

crypto.getRandomValues() draws entropy from the operating system — hardware events, thermal noise, mouse movements — sources that are genuinely unpredictable. This is what password managers, two-factor tokens, and encryption libraries use. This tool uses crypto.getRandomValues() when available.

Uniform distribution

A good random number generator produces a uniform distribution: each value in the range is equally likely. If we generate 10,000 numbers between 1 and 10, each digit should appear roughly 1,000 times.

In practice, most generators have slight biases from modulo operations. For small ranges (like 1–100), these biases are statistically negligible.

Unique (no-repeat) generation

Generating N unique values from a range is a shuffle problem. We create an array of all values in the range, shuffle it using the Fisher-Yates algorithm (each swap uses a cryptographically random index), then take the first N items. This guarantees uniformity — every ordering is equally likely.

Common use cases

  • Lotteries: Set Min/Max to the lottery range (e.g., 1–49), enable Unique, set count to 6
  • Dice simulation: Min 1, Max 6, Count 1 (or 2 for two dice)
  • Random sampling: For research or testing where you need an unbiased subset of IDs
  • Randomised order: Generate unique numbers, sort by result — creates a random ordering

What this tool does not do

This tool generates uniform integers. It does not generate floating-point numbers, Gaussian (bell-curve) distributions, or cryptographic keys. For key generation, use a dedicated tool or library.