Random Number Generator

Random numbers
Next

Generate random numbers in any range you specify. Choose integers or decimals, set the minimum and maximum, pick how many numbers you need in one go and whether duplicates are allowed. Backed by the browser’s cryptographic RNG, so the output passes statistical randomness tests.

How to generate random numbers

  1. 1

    Set the range

    Minimum and maximum are inclusive. Both can be negative.

  2. 2

    Pick type

    Integers or decimals. For decimals, choose how many digits to show.

  3. 3

    Set count and uniqueness

    Allow repeats (independent draws) or require unique (no number appears twice).

  4. 4

    Generate

    The numbers appear comma-separated or one per line, depending on your copy mode.

What “random” means here

The tool uses the Web Crypto API (crypto.getRandomValues), which draws from the operating system’s entropy pool. For ranges that fit in 32 bits this is indistinguishable from true randomness for any practical purpose, passes dieharder and TestU01 suites.

For very small ranges (2-255) the tool uses rejection sampling to avoid modulo bias, which would otherwise make some numbers slightly more likely.

Typical uses

Use Setup
Dice roll (d6) Integers 1-6
Lottery mockup (6 of 49) Integers 1-49, count 6, unique
Test fixtures (IDs) Integers 1000-9999, unique
Fractional simulation Decimals 0-1, 6 digits
Coin flip Integers 0-1
Pick a winner from N entries Integers 1-N, count 1

Regulated use

For any context with legal or audit requirements (gambling, official draws, cryptographic keys) use a certified RNG with provenance records. Browser RNGs are excellent but not certified.

Frequently Asked Questions

If you take a 32-bit random number modulo 10, the last few values of the 32-bit range produce slightly more zeros than nines. For small ranges the bias is negligible; for gambling-grade fairness, use rejection sampling (which this tool does).

No. The Web Crypto API is not seedable: that is by design. For reproducibility (shared test fixtures, scientific experiments) use a seeded PRNG library instead.

Up to 2^53 - 1 for safe integers, which covers practically every non-cryptographic use. For arbitrary-precision, use a dedicated big-integer tool.

Yes: both the minimum and maximum are included in the output range, to within the displayed number of digits.

Related Tools

Tool available in other languages