Random Number Generator

Pick random numbers between any min and max. Integer or decimal output, with or without duplicates. Browser-only, uses cryptographically-strong randomness.

Example: min=1, max=10047

Generates random numbers between a minimum and maximum value, using the browser's crypto.getRandomValues for cryptographically-strong randomness — not predictable like Math.random.

Default behaviour returns 10 integers between 1 and 100. Useful for rolls, draws, sampling, and anywhere you need a defensible "truly random" pick.

What people generate this for

Lottery / raffle / giveaway draws

Pick a winner number from your participant list (1 to N). Cryptographically random; defensible if anyone questions the pick.

Dice rolls

Roll one or many dice of any face count. 1–6 for d6, 1–20 for d20, 1–100 for percentile.

Random sampling

Pick N random rows from a list of M for a quick-look spot check or QA pass.

Game mechanics

Random-event triggers, damage rolls, loot drops — any game logic that needs a roll.

Test data generation

Generate random IDs, prices, or quantities for QA test data — much faster than typing fake numbers by hand.

How the randomness works

The tool uses the Web Crypto API's crypto.getRandomValues() to generate cryptographically strong random values. Under the hood, it draws 32-bit unsigned integers from the operating system's CSPRNG (e.g., /dev/urandom on Unix). For integer output, it maps the raw 32-bit value to the requested range via modulo reduction, rejecting out-of-range values to eliminate bias. For decimal output, it divides by 2^32 to produce a uniform float in [0,1), then scales to the desired interval. This avoids the predictable linear congruential generator used by Math.random().

The tool never seeds; every call pulls fresh entropy. Duplicate prevention is enforced client-side by storing generated numbers in a Set and discarding collisions until the requested count is met (practically limited by the range size). All computation occurs in the browser; no data is sent over the network.

How to use this generator

  1. Set the minimum and maximum values (e.g., 1 and 100).
  2. Choose output type: integer or decimal (number of decimal places).
  3. Toggle duplicate handling: allow duplicates or enforce unique values.
  4. Click “Generate” to produce a set of random numbers instantly.

Behavior on tricky inputs

Min > Max
Returns an empty set or prompts to correct the order; no numbers generated.
Range smaller than requested count
Unique mode will loop indefinitely; tool warns or caps at range size.
Very large range ( > 2^53 )
Precision is limited by IEEE-754 double; min and max are treated as inclusive but decimal generation may lose precision.
Decimal with zero range
When min equals max, every “random” number is that fixed value, regardless of type.

Tips for getting better output

  • For lottery draws or contest winners, always use integer mode with no duplicates for a fair, audit-friendly sequence.
  • Pair with a seed based on current time if you need reproducible sequences for testing—but note this tool uses cryptographic randomness and doesn't expose seeding.
  • When generating decimals for statistical sampling, set precision to at least 6 places to avoid discretization artifacts.
  • To avoid bias, ensure the requested range is not an exact power of 2 when using rejection sampling; the tool handles this internally.

vs other random sources

How does this browser-based generator stack up against common programmatic alternatives?

This toolPython random moduleSpreadsheet (RAND)
Randomness sourcecryptographic (crypto.getRandomValues)Mersenne Twister (predictable)Spreadsheet-specific PRNG (often linear congruential)
Integer / decimalBoth, with configurable decimal placesrandint() for integers, uniform() for decimalsRAND() only returns decimals; RANDBETWEEN() for integers
Duplicate handlingOptional enforced uniqueness client-sideManual coding (sample() or while loops)No built-in; requires drag and manual check
Privacy & offlineFully offline, no network callsScript runs locally, but code must be trustedOnline spreadsheet sends data to server

A bit of history

The concept of generating random numbers mechanically dates to dice in antiquity (3000 BCE). In computing, John von Neumann proposed the Middle-Square method in 1946, but modern cryptographically secure pseudo-random number generators (CSPRNGs) emerged in the 1990s with algorithms like Yarrow (1999) and Fortuna. The Web Crypto API was standardized in 2014, giving browser applications direct access to the operating system’s entropy pool — replacing the weaker Math.random() which, on most engines, uses a non-cryptographic PRNG like xorshift128+.

FAQ

Is the randomness really random?

It uses crypto.getRandomValues — the browser's cryptographically-secure source. Suitable for raffles and other high-stakes draws.

Can I generate numbers with duplicates?

By default, yes — each draw is independent, so duplicates are possible. To pick unique numbers from a range, generate more than you need and dedupe with Remove Duplicate Lines.

Can I get decimal numbers?

The default is integer-only. For decimals, multiply your bounds and divide the output (e.g. min=0, max=10000, then divide by 100 in your head).

How does this compare to a physical die?

Indistinguishable for any practical purpose. The cryptographic randomness is at least as fair as any physical die or coin you could roll.

Embed our tools on your website

Free for any site. No signup. Iframe loads from our servers and stays up-to-date automatically.

📋 Embed the Word Counter

Copy this snippet:

Live preview:

📋 Embed this Random Number Generator

Copy this snippet:

Live preview:

Want more options? All embeddable tools →