Random Number Generator
Generate cryptographically secure random integers or decimals within a range.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
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
- Resolve the random source: the injected or seeded source for reproducible runs, otherwise the platform CSPRNG.
- Read a 53-bit uniform double from two 32-bit halves, or a uniform integer with rejection sampling to avoid modulo bias.
- For unique mode, perform a partial Fisher–Yates shuffle over the range indices so no value repeats.
- Scale the draws into the requested range and round decimals to the requested precision.
Usage
- Enter the minimum and maximum of the range.
- Choose how many values you need, and whether they must be unique.
- Switch off integer mode for decimal values and set the decimal places.
- 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
{
"min": 1,
"max": 100,
"count": 5,
"unique": true,
"seed": "example"
}Three dice rolls
{
"min": 1,
"max": 6,
"count": 3,
"seed": "example"
}Four decimals between 0 and 1
{
"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
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.