Skip to main content

Random Number & Distribution Lab

Secure or seeded random numbers, samples, shuffles and distributions with statistics

Input

Both bounds are included.

Results

No values yet
Set the input, choose a random source, then press Generate.

Options

Random source

Cryptographic mode uses browser secure randomness. It cannot be reproduced from a seed.

Algorithm
crypto.getRandomValues
Advanced

What it does

Random Number & Distribution Lab generates random integers, decimal numbers, unique samples, shuffled lists, weighted picks and values from the uniform, normal, exponential and Poisson distributions. Numeric results come with a statistical summary and a histogram, and every result can be copied or downloaded as TXT, CSV or JSON. Everything runs in your browser.

Secure versus seeded

Secure mode draws from crypto.getRandomValues, the browser’s cryptographic generator, and can never be reproduced. Seeded mode uses the documented xoshiro128** generator, seeded by hashing your seed text with MurmurHash3, so the same seed and settings always return the same values. Seeded output is meant for tests, simulations and demos that must be repeatable; it is not secure and should never be used for passwords, keys or tokens. Exports of seeded runs include the seed and the algorithm.

How values are drawn

Integers include both bounds and use rejection sampling, so there is no modulo bias. Decimals fall in [min, max): the maximum is never returned, also when you round to a fixed number of decimal places. Unique samples use a partial Fisher–Yates shuffle or Floyd’s algorithm instead of retrying duplicates, shuffles use Fisher–Yates, and weighted picks use the alias method with replacement or sequential removal without replacement. Normal values use the Marsaglia polar method, exponential values inverse-transform sampling, and Poisson values Knuth’s method below λ 30 and the PTRS method up to λ 10,000,000.

Statistics and limits

The summary lists count, minimum, maximum, mean, median, the sample variance (n − 1) and the population variance (n), the standard deviation and the 25th, 75th, 95th and 99th percentiles (linear interpolation). Distribution mode also shows the expected mean and variance. Histograms use Freedman–Diaconis bins with a Sturges fallback and whole-number bins for integer data. A run can produce up to 1,000,000 values (100,000 unique values or shuffled items, 1,000 weighted rows); the page shows the first 1,000 and larger runs work in the background.

Frequently asked questions
What is the difference between Secure and Seeded mode?
Secure mode draws from crypto.getRandomValues, the browser cryptographic generator, and can never be reproduced. Seeded mode uses the xoshiro128** generator seeded by a MurmurHash3 hash of your seed text, so the same seed and settings always give the same values. Seeded output is for tests, simulations and demos, not for secrets.
Are the integers free of modulo bias?
Yes. Bounded integers use rejection sampling: draws from the biased tail of the 32-bit or 53-bit range are discarded and redrawn, so every integer between the inclusive bounds is equally likely.
Is anything sent to a server?
No. Generation, statistics, the histogram and exports run in your browser. Seeds, lists and weights are not stored, logged or added to the URL; only the selected mode, source and copy separator are remembered on your device.

CodingTool is officially live on