Free Online Random Number Generator

Generate random numbers with custom range, quantity, and options. Includes a dice roller for tabletop gaming.

Settings

Allow the same number to appear more than once

Sort generated numbers in ascending order

Results

Click Generate to create random numbers

Learn More

How Random Number Generation Works

This tool uses the Web Crypto API (crypto.getRandomValues) when available, which provides cryptographically secure random numbers. Unlike Math.random() which uses a pseudorandom number generator (PRNG) with predictable sequences if you know the seed, crypto.getRandomValues draws from your operating system's entropy pool: mouse movements, disk timing, network noise, and hardware interrupts.

For most use cases (games, raffles, sampling), the distinction doesn't matter much. But if you're generating numbers for security purposes (lottery systems, cryptographic keys), the crypto API provides genuinely unpredictable output.

The uniform distribution means every number in your range has an equal probability of being selected. If you generate a number between 1 and 100, each number has exactly a 1% chance. There's no "hot" or "cold" number, no matter what gambler's fallacy might suggest.

Common Uses for Random Numbers

Picking lottery numbers or raffle winners

Generate unique random numbers within your lottery's range. The "no duplicates" option means each number appears only once, which is perfect for picking 6 unique numbers from 1–49.

Tabletop gaming and RPGs

Roll any combination of dice: d4, d6, d8, d10, d12, d20, or d100. The dice roller shows individual results and totals, just like rolling physical dice but without losing them under the couch.

Random sampling for research

Need to randomly select 50 participants from a list of 500? Generate 50 unique numbers between 1 and 500, then pick the corresponding entries from your list.

Making decisions or breaking ties

Can't decide between 3 restaurants? Generate a number from 1–3. It's faster than flipping coins and works for any number of options.

Tips for Using Random Numbers

1

Use "no duplicates" for lottery-style picks

Most lotteries draw without replacement. Once a number is picked, it can't appear again. Enable the unique/no-duplicates option to simulate this correctly.

2

Larger samples are more representative

If you're using random numbers for statistical sampling, larger sample sizes reduce bias. A random sample of 30 from a population of 1,000 might not be representative, but 100 usually is.

3

Dice notation: NdX means N dice with X sides

2d6 means roll two six-sided dice and sum them. 1d20 is a single twenty-sided die. 3d8+5 means roll three eight-sided dice, sum them, and add 5. This is standard tabletop RPG notation.

Limitations

  • Uses crypto.getRandomValues() for cryptographically secure randomness. Not suitable for reproducible sequences (use a seeded PRNG for that).
  • Integer range is limited to safe integer bounds (±9,007,199,254,740,991). For larger numbers, precision is lost.
  • Cannot generate random numbers following specific statistical distributions (normal, Poisson, exponential). Output is uniformly distributed only.
  • No duplicate prevention in batch generation by default. If you need unique numbers, use a different approach or filter duplicates yourself.

Features

  • Custom range: set any minimum and maximum value
  • Generate multiple numbers at once (up to 1,000)
  • Option to allow or prevent duplicate numbers
  • Built-in dice roller with standard RPG dice (d4, d6, d8, d10, d12, d20, d100)
  • Cryptographically secure via Web Crypto API
  • Sort results in ascending or descending order
  • Copy results to clipboard

Frequently Asked Questions

Are the numbers truly random?

They're as random as your computer can produce. The tool uses the Web Crypto API which draws from your OS entropy pool (hardware noise, timing jitter). For all practical purposes (games, raffles, sampling), these are indistinguishable from "true" random numbers.

Can I generate unique (non-repeating) numbers?

Yes. Enable the "no duplicates" option and each number will appear at most once in your results. Note: you can't generate more unique numbers than exist in your range (e.g., you can't get 20 unique numbers from a 1–10 range).

What is the maximum range?

The tool supports ranges up to several billion (limited by JavaScript's safe integer range of ±9,007,199,254,740,991). For practical purposes, any range you'd reasonably need is supported.

How does the dice roller work?

Select the type of die (d4 through d100), choose how many to roll, and click roll. Each die is rolled independently using the same cryptographic random source. Results show individual rolls and the total sum.

Can I use this for gambling or lottery purposes?

You can use it to pick numbers, but this tool has no connection to any lottery system. The numbers generated here are independent of any lottery draw. No random number generator can predict or influence lottery outcomes.

Last reviewed:

Your Privacy

All random number generation happens entirely in your browser using crypto.getRandomValues(). No data is uploaded to any server. Generated numbers never leave your device.

In-Depth Guide

Random Numbers in Programming: PRNG, CSPRNG, and When It Matters

Math.random() is not random enough for security. This guide explains PRNG vs CSPRNG, seed behavior, and when to use which in games, simulations, and security.

Read guide

Tips & Related Workflows