Random Number Generator

Generate one or more numbers between any minimum and maximum. Choose integers or decimals, and optionally exclude values or require unique results.

Pick a number

Smallest possible value
Largest possible value
Decimal precision is in Advanced options
1–500 values per set

Result

Choose settings, then select Generate.

Quick presets

Advanced options
1–12; decimal inputs are rounded to this precision
For example, 0.25 or 5
Weighted modes are intentionally non-uniform
Comma-separated values or inclusive ranges
1–50 groups
With unique draws, reuse resets the pool for each set

Eligible values will appear here.

Sampling note: repeats use sampling with replacement. Unique results use sampling without replacement, so every pick reduces the remaining pool.

Draw history (this tab only)
  1. No draws yet.

Advertisement

How to use the generator

  1. Enter a minimum and maximum, select integers or decimals, and choose how many results you need.
  2. Select Generate. The result and its range, count, repeat mode, and distribution appear together.
  3. Open Advanced options for precision, steps, excluded values, unique draws, multiple sets, sorting, and output formats.
  4. Copy the formatted result or download it as CSV or JSON. History lasts only until this page is reloaded or closed.

Worked examples

Pick one from 1–10

Settings: 1 to 10, integer, count 1.

Interpretation: each integer has a 1 in 10 chance.

Roll a six-sided die

Settings: 1 to 6, integer, count 1.

Interpretation: the output is one fair virtual die face.

Generate a four-digit number

Settings: 1000 to 9999, integer, count 1.

Interpretation: every result contains exactly four digits.

Shuffle 1–30

Settings: 1 to 30, count 30, unique.

Interpretation: every integer appears once in random order.

Five decimal test values

Settings: 0 to 1, 3 decimal places, count 5.

Interpretation: values come from 0.000 through 1.000.

Lottery-style sets

Settings: 1 to 49, 6 unique values, 3 sets, reuse allowed.

Interpretation: each set has six different numbers; later sets may repeat earlier numbers.

Methodology, probability, and limits

Uniform integer rule

For an inclusive integer range, the rule is X = min + floor(U × N), where N = max − min + 1 and U is a uniform value in [0, 1). Therefore every allowed value has probability 1/N. This implementation uses equivalent exact BigInt rejection sampling, which avoids modulo bias even when the domain is larger than 232.

Decimals, endpoints, and unique draws

Decimal precision converts values to a finite integer grid: at two decimal places, 1.25 becomes 125 and the default step is 1 on that scaled grid (0.01 when displayed). A custom step selects a wider evenly spaced sequence. Endpoint options then remove the minimum, maximum, or both when those values lie on the sequence. Exclusions remove more eligible points.

Repeatable sampling uses replacement, so each draw keeps the same probabilities. Unique sampling uses no replacement: after one of N values is selected, each remaining value has probability 1/(N − 1) on the next draw. Weighted modes deliberately change those probabilities and are not fair uniform draws.

Browser and numerical limits

  • Decimal precision is limited to 12 places. Decimal text is converted directly to scaled BigInt values, rather than unsafe binary floating-point integers.
  • Inputs may use exponents from −5000 to 5000, and each scaled value is limited to 5,000 digits. The interface reports an error instead of rounding beyond these documented limits.
  • Each set can contain up to 500 values and a draw can contain up to 50 sets. Excluded ranges are processed as intervals, so large domains do not have to be stored in memory.
  • The generator requires crypto.getRandomValues(). It does not fall back to Math.random(); if Web Crypto is unavailable, generation stops with an accurate error.
  • Weighted modes use a 53-bit Web Crypto fraction to shape the distribution. Use uniform mode whenever equal probabilities matter.

Trust and suitability

Maintainer: Starlight Robotics editorial team

Technical review: Starlight Robotics engineering team

Last tested: 17 July 2026

Processing: Client-side in this browser tab

Cost: Free to use

“Client-side” means the inputs, draws, and temporary history are processed in this page and are not uploaded by the generator. Web Crypto supplies cryptographically strong pseudorandom bytes, but this general-purpose interface is not an audited drawing system. Do not use it for regulated raffles, regulated gambling, or security-key, password, token, or seed generation.

Technical references: W3C Web Cryptography API: getRandomValues and MDN Web Docs: Crypto.getRandomValues().

FAQs

What does RNG mean?

RNG means random number generator: a system that selects values from a defined set using a source of randomness.

Are the results truly random or pseudorandom?

They are cryptographically strong pseudorandom results supplied by your browser’s Web Crypto API and ultimately seeded by the operating system. They are not measurements of a physical true-random process.

Are the minimum and maximum included?

Yes by default. Advanced endpoint settings can exclude either or both endpoints. A maximum is included only when it lies on the selected stepped sequence.

Can results be negative or decimal?

Yes. Minimum and maximum can be negative, and Decimal mode supports 1 to 12 decimal places with an optional step size aligned to that precision.

Can I exclude numbers?

Yes. Enter comma-separated values or ranges such as 3, 8-12, or -5--2. Every exclusion must be inside the selected stepped domain.

How do unique draws work?

Unique results sample without replacement, so a value cannot repeat within a set. For multiple sets, you can allow reuse in the next set or remove selected values across every set.

What is the probability of each result?

In uniform mode, each of N eligible values has probability 1/N on the first draw. With unique results, the next draw has probability 1/(N − 1) for each remaining value. Weighted modes are intentionally biased.

Can I generate a number from 1–10 or 1–100?

Yes. Enter those bounds or use the 1–10 and 1–100 preset buttons to load the settings instantly.

Are inputs or results stored?

No. Generation and temporary draw history stay in this page’s browser memory and are not uploaded. Reloading or closing the page clears the history.

Can I use this for raffles, gambling, passwords, or cryptography?

It is suitable for informal games, classroom draws, tests, and non-regulated raffles. Do not use it for regulated drawings or gambling, and use a dedicated audited generator for passwords, keys, tokens, or other security material.

Explore more tools