Random Number Generator

Random integers in any range, plus a dice roller.

🎲 Roll a die

What is a random number generator and why use one?

A random number generator (RNG) produces numbers that cannot be predicted in advance. It is the digital equivalent of drawing a number from a hat, rolling dice or flipping a coin. People use it for everything from classroom activities and party games to prize draws, board games and quick decision-making. Our generator runs entirely in your browser — no server calls, no waiting, no logs.

How the random number generator works

We use your browser's built-in Math.random() function, which returns a floating-point number between 0 (inclusive) and 1 (exclusive). To turn that into a random integer in a custom range [min, max], the formula is:

Random integer = ⌊ Math.random() × (max − min + 1) ⌋ + min

The ⌊ ⌋ symbol means "round down to the nearest integer". When you ask for multiple numbers, the process repeats independently each time. Each number has an equal probability of landing anywhere in the range you set.

Step-by-step: pick a random number

  1. Enter a minimum value. The smallest number you want to include — for example 1.
  2. Enter a maximum value. The largest number you want to include — for example 100. Make sure max ≥ min.
  3. Choose how many numbers. Set to 1 for a single pick, or higher to generate a list. Duplicates are allowed when generating multiple numbers, just like drawing with replacement.
  4. Click Generate. Your random number(s) appear instantly above.

Practical examples

Dice roller — how it works

The built-in dice roller simulates a standard 6-sided die (D6). Each face (⚀⚁⚂⚃⚄⚅) appears with equal probability, exactly like a physical die. It is perfect for board games when you do not have dice handy, or for online play with friends.

For different die types (D4, D8, D10, D12, D20), simply use the random number generator above and set the range accordingly — for a D20, set min=1 and max=20.

Is Math.random() secure?

No. Math.random() is a pseudo-random generator — it is fast and well-distributed for everyday use, but its output is technically predictable to a determined attacker. It is completely fine for games, draws, teaching and casual decisions. For cryptographic purposes (secure keys, passwords, tokens), use window.crypto.getRandomValues() or a dedicated library instead.

FAQ

How random are the numbers?

We use your browser's built-in Math.random(), which is fine for games, draws and everyday decisions — but not for cryptographic or security purposes.

Can I generate multiple numbers at once?

Yes. Set "How many" to the number of random values you want. Each is generated independently, so duplicates are possible, just like drawing with replacement.

How do I roll a 20-sided die (D20)?

Use the random number generator with min=1 and max=20. That gives a uniform random integer from 1 to 20, equivalent to a D20.

Is Math.random() secure for passwords?

No. Math.random() is a pseudo-random generator, not cryptographically secure. Use window.crypto.getRandomValues() for anything security-sensitive.

Are the numbers truly random?

No computer-generated number is truly random. Math.random() is pseudo-random: it uses an algorithm seeded by the system clock, producing a sequence that is unpredictable enough for everyday use.