Runs 100% in your browser — nothing is uploaded
Crypto, Hashing & Security

Random Number Generator

Generate cryptographically strong random integers or decimals in bulk, with range, duplicate, and sort controls.

Random Number Generator
Client-side

About this tool

The Random Number Generator produces random integers or decimals using crypto.getRandomValues, the browser's cryptographically secure pseudorandom number generator — not Math.random(), which is not designed to be unpredictable and should never be relied on for anything security-sensitive or statistically rigorous.

For integer generation, the tool uses rejection sampling over a Uint32Array: rather than naively taking a random value modulo the range size (which introduces a subtle bias favoring smaller numbers), it discards values that would cause that bias and resamples, guaranteeing a uniform distribution across the requested range. Decimal mode scales a random fraction into the target range at your chosen precision (2, 4, or 6 decimal places).

You control the minimum and maximum bounds, how many numbers to generate at once (1–100), whether duplicates are allowed, whether results are sorted ascending, and integer vs. decimal mode. Requesting more unique values than a range can actually supply is caught and reported as a clear error rather than hanging or silently returning fewer values than asked.

Results are displayed as a list with a one-click copy-all button. Common uses: picking a random sample, generating test data, running a raffle, seeding a game mechanic, or getting unbiased random values for a statistics exercise. Everything runs locally with zero network requests.

FAQ

Why use crypto.getRandomValues instead of Math.random()?
Math.random() has no guarantee of unpredictability or uniform distribution across implementations. crypto.getRandomValues draws from the operating system's cryptographically secure entropy source, the same one used for generating encryption keys.
What is rejection sampling and why does it matter here?
Naively computing a random value modulo your range size introduces "modulo bias" — some numbers become statistically more likely than others. Rejection sampling discards out-of-bounds draws and resamples, guaranteeing every value in the range is equally likely.
Why did I get an error asking for more unique numbers than the range allows?
If you request more unique integers than the range contains possible values, it is mathematically impossible to satisfy without duplicates. The tool detects this up front and reports a clear error.
What is the difference between integer and decimal mode?
Integer mode returns whole numbers using bias-free rejection sampling. Decimal mode returns fractional numbers scaled into your chosen range at 2, 4, or 6 decimal places.
Is there a limit on how many numbers I can generate at once?
Yes, up to 100 numbers per generation to keep the tool responsive and results readable. Run the generator multiple times for larger datasets.