Random Number Generator

Generate cryptographically secure random integers or decimals within a range.

  • Runs locally in your browser
  • No upload required

Try it

Leave empty for unpredictable output from the browser CSPRNG.

Numbers
34, 71, 69, 34, 39
Count
5
Source
platform CSPRNG
Formula
5 integer value(s) in [1, 100]

Supported formats

Input
number, boolean, text
Output
number

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Generated 5 value(s) in [1, 100] from the reproducible seed.

How it works

  • Read the range, count and integer/decimal mode.
  • Drew bytes from the selected random source.
  • Mapped each draw to a distinct range index with a partial Fisher–Yates shuffle.
  • Reported the values and whether the source was the CSPRNG or a reproducible seed.
  • A seeded run is reproducible by design and must not be used where unpredictability is required.
  • Unique mode can never produce a duplicate because it samples without replacement.

Methodology

  1. Resolve the random source: the injected or seeded source for reproducible runs, otherwise the platform CSPRNG.
  2. Read a 53-bit uniform double from two 32-bit halves, or a uniform integer with rejection sampling to avoid modulo bias.
  3. For unique mode, perform a partial Fisher–Yates shuffle over the range indices so no value repeats.
  4. Scale the draws into the requested range and round decimals to the requested precision.

Usage

  1. Enter the minimum and maximum of the range.
  2. Choose how many values you need, and whether they must be unique.
  3. Switch off integer mode for decimal values and set the decimal places.
  4. Generate and copy the values.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Five unique integers from 1 to 100

jsonSelect to copy
{
  "min": 1,
  "max": 100,
  "count": 5,
  "unique": true,
  "seed": "example"
}

Three dice rolls

jsonSelect to copy
{
  "min": 1,
  "max": 6,
  "count": 3,
  "seed": "example"
}

Four decimals between 0 and 1

jsonSelect to copy
{
  "min": 0,
  "max": 1,
  "count": 4,
  "integer": false,
  "decimals": 4,
  "seed": "example"
}

Limitations

Uniform, not “random enough”

A naive `random() % n` skews the result toward small numbers whenever n does not divide the generator's range. This tool uses rejection sampling so every value in the range is equally likely.

For unique draws it shuffles range indices rather than retrying collisions, which stays fast and exact even for a small range and a large count.

Frequently asked questions

Is the output truly random?
The default path uses the Web Crypto `getRandomValues` source, which is a cryptographically secure pseudorandom generator seeded by the operating system. The tool also uses rejection sampling so the values are uniform, not modulo-biased.
What does the seed do?
The seed makes the output reproducible: the same seed and the same request always produce the same values. That is what lets the worked examples and tests be deterministic; it must not be used where unpredictability matters.
Can the same number appear twice?
Only when unique mode is off. With unique mode on, the tool samples without replacement using a partial Fisher–Yates shuffle, so every value is distinct.

Sources

  1. RFC 4086: Randomness Requirements for Security — IETF
  2. MDN Web Docs — Crypto.getRandomValues() — MDN