Figuro.net
Blog

Random Number Generator

Generate a cryptographically secure random whole number within any range.

Enter values and press Calculate to see the result here.

How this is generated

A cryptographically secure random value (crypto.getRandomValues) is mapped into your 1–100 range, so results aren't predictable.

How random number generation works

Computer-based random number generators typically fall into two categories: pseudorandom number generators (PRNGs), which use a deterministic algorithm seeded with an initial value, and true random number generators (TRNGs), which draw from physical entropy sources like hardware noise. Most everyday tools, including browser-based generators, use cryptographically secure PRNGs suitable for non-security-critical purposes like games, sampling, or draws.

Range-based generation

Random integer in [min, max] = min + floor(random(0,1) × (max − min + 1))

This formula maps a uniformly distributed decimal between 0 and 1 onto a specific integer range, ensuring every integer in the range has an equal probability of being selected.

Common uses

Use caseTypical setup
Dice roll simulationInteger between 1 and 6
Raffle/giveaway winnerInteger between 1 and total entries
Sampling from a datasetUnique random integers within a range, no repeats
Lottery number generationMultiple unique integers within a defined range

With or without repetition

Randomness quality considerations

Frequently asked questions

Is this type of random number generator suitable for gambling or lotteries? Regulated gambling and lottery systems require certified, audited random number generators — general-purpose tools like this are best suited for casual, non-regulated use like games or informal drawings.

Can the same number be generated twice in a row? With repetition enabled, yes — each generation is an independent event, so repeats are statistically expected over many draws.

What's the difference between pseudorandom and truly random? Pseudorandom numbers are produced by a deterministic algorithm that appears random but is technically reproducible from its seed, while true randomness draws from unpredictable physical processes.

Why use crypto.getRandomValues() instead of Math.random()? Math.random() is a fast, non-cryptographic PRNG that can be predictable in some implementations, while crypto.getRandomValues() draws from a cryptographically secure source, making it more suitable when unpredictability actually matters.

How can I generate a list of unique random numbers without duplicates? Use the "without repetition" mode, which removes each generated number from the available pool before the next draw, guaranteeing no repeats within that batch.

Does the range size affect randomness quality? No — a well-implemented generator maintains uniform probability across any range size, whether it's 1–6 or 1–1,000,000.

Can I use this to simulate multiple dice or draw several numbers at once? Yes — generating several independent random integers in sequence (with repetition allowed) accurately simulates multiple dice rolls or similar repeated random events.

Another worked example

Generating a number between 1 and 100 gives each of the 100 possible outcomes an equal, independent chance — useful for anything from picking a raffle winner to choosing a random starting point for a game.

How to use this calculator

  1. Enter the minimum and maximum values for your range.
  2. Press Generate to produce a random whole number within that range.

Common mistakes to avoid

Key terms explained

Pseudo-random: Numbers generated by an algorithm that appear random but are technically deterministic and potentially predictable.

Cryptographically secure: A random number source designed to be unpredictable, suitable for security- or fairness-sensitive applications.

← Browse all 40 calculators