Skip to content

Random Number Generator

Generate one or many random numbers in any range. Integers or decimals, unique or repeatable, with optional reproducible seed.

Generator settings

Updates as you type
Preset
Quick start ?
Range
Minimum value ?
01005001000
Maximum value ?
01005001000
Quantity
How many numbers ?
11050100
Number type ?
Options
Duplicates ?
Sort ?
Seed ? Random
Display (optional)
Copy format

Examples

How It Works

This generator uses the browser's crypto.getRandomValues() API — the same CSPRNG (cryptographically secure pseudo-random number generator) used for cryptographic keys and session tokens. It's suitable for games, simulations, sampling, and anything short of protecting secrets directly.

For integer generation, we use rejection sampling to eliminate modulo bias. A naive val % range is slightly biased when the raw random space isn't evenly divisible by the range — so values above the largest clean multiple of the range are discarded and resampled. The result: a perfectly uniform distribution.

The unique mode uses two strategies depending on density. When your count is close to the range (e.g., 6 from 1–49), we build the full pool and Fisher–Yates shuffle it. When the range is much larger than the count, we keep drawing and skip any value we've already seen. The unique constraint requires the integer range to contain at least as many values as you ask for.

The optional seed replaces the CSPRNG with a deterministic PRNG (mulberry32). Given the same inputs and the same seed, the sequence is identical every time — useful for reproducible demos, test fixtures, and shareable links. Leave the seed blank for true randomness.

Tips & Best Practices

Use the Seed field when you need the same sequence twice — share the generated link and anyone gets the same numbers.
Unique mode needs enough room: to draw N unique integers, the range must contain at least N values.
Switch to Decimals and raise precision when you need sub-unit granularity (e.g., random probabilities or simulation inputs).
For larger samples (100+), the distribution histogram shows whether your draw looks uniform at a glance.
Copy format matters: JSON and CSV are meant for downstream tools; comma and newline are meant for humans.

Frequently Asked Questions

Is this cryptographically secure?

When the seed field is empty, yes — output comes from your browser's crypto.getRandomValues(), which is suitable for cryptographic use. If you set a seed, the output becomes deterministic and is NOT secure: anyone who knows the seed can reproduce the sequence.

Unseeded draws use a CSPRNG — each roll is independent and unpredictable. Seeded draws use a deterministic PRNG (mulberry32): the same seed + settings always produces the same sequence, which is what you want for reproducible demos, tests, or shareable links.

The range only contains 10 distinct integers, so it's mathematically impossible to draw 100 unique values. Either reduce the count to 10 or less, or expand the range so it's at least as large as the count.

No. Sorting rearranges already-generated numbers; it doesn't change which numbers were drawn. The random process happens first, sorting happens after.

Up to 10,000 numbers at a time. Very large grids render in a scrollable area, and the distribution histogram becomes more meaningful as the sample grows.