User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Producing statistically sound random number sets requires more than calling Math.random. This generator uses the crypto.getRandomValues API when available, providing cryptographically secure pseudorandom output suitable for simulations, sampling, and lottery-style draws. You configure the range [min, max], quantity n, step constraint s, uniqueness, sorting order, and distribution model. Misconfigured parameters - requesting 500 unique integers from a pool of 100 - produce silent data gaps in naive tools. This tool validates constraints before generation and reports conflicts explicitly.

Three distribution modes are supported: uniform, Gaussian (normal via the Box-Muller transform with configurable ฮผ and ฯƒ), and weighted custom ranges. The step parameter restricts output to the arithmetic sequence min + k โ‹… s, useful for generating multiples or fixed-resolution grids. Exclusion lists remove unwanted values from the output pool before sampling. Note: Gaussian mode produces floating-point results clamped to [min, max]; extreme ฯƒ values relative to range width will cluster output near the mean and increase rejection rate.

random number generator custom numbers number list generator unique random numbers gaussian distribution number generator tool

Formulas

Uniform integer generation maps a secure random byte to the target range using rejection sampling to eliminate modulo bias:

X = min + step โ‹… floor(U โ‹… poolSize)

where U โˆˆ [0, 1) is a uniform random float and poolSize = floor((max โˆ’ min) รท step) + 1.

For Gaussian distribution, the Box-Muller transform converts two uniform samples into a standard normal variate:

Z = โˆšโˆ’2 โ‹… ln(U1) โ‹… cos(2ฯ€U2)

The output is then scaled and shifted: X = ฮผ + ฯƒ โ‹… Z, then clamped to [min, max].

For unique generation, the Fisher-Yates shuffle is applied to the full pool array and the first n elements are selected, guaranteeing O(n) time without retry loops when n โ‰ค poolSize. When the pool exceeds 1,000,000, a Set-based rejection method is used instead to avoid memory exhaustion.

Where min = lower bound, max = upper bound, step = spacing, n = count, ฮผ = mean, ฯƒ = standard deviation, U1 and U2 = independent uniform random samples.

Reference Data

ParameterDefaultRangeDescription
Minimum1โˆ’1,000,000 to 1,000,000Lower bound (inclusive)
Maximum100โˆ’1,000,000 to 1,000,000Upper bound (inclusive)
Count101 to 100,000Numbers to generate
Step10.001 to 1,000,000Spacing between valid values
Decimals00 to 10Decimal places in output
UniqueNoYes / NoPrevent duplicate values
SortNoneNone / Asc / DescOutput ordering
DistributionUniformUniform / Gaussian / WeightedStatistical distribution model
Mean (ฮผ)50Any within rangeCenter of Gaussian bell curve
Std Dev (ฯƒ)15> 0Spread of Gaussian distribution
ExclusionsEmptyComma-separatedValues to exclude from output
DelimiterNewlineNewline / Comma / Space / Tab / CustomSeparator between output numbers
PrefixEmptyAny stringPrepended to each number
SuffixEmptyAny stringAppended to each number
Max Pool (Unique) - Computed(max โˆ’ min) รท step + 1 โˆ’ exclusions

Frequently Asked Questions

When uniqueness is enabled, the tool first computes the valid pool: all values from min to max at the given step, minus excluded values. If the requested count exceeds this pool size, generation is refused with an explicit error showing the maximum available. For example, range [1, 10] with step 2 yields pool {1, 3, 5, 7, 9}. Excluding 5 leaves 4 values. Requesting 5 unique numbers from this set is impossible and flagged.
Uniform distribution gives every valid value equal probability. Gaussian (normal) distribution clusters results around the mean ฮผ with spread controlled by ฯƒ. Approximately 68% of values fall within ยฑ1ฯƒ of the mean, 95% within ยฑ2ฯƒ, and 99.7% within ยฑ3ฯƒ. Values outside [min, max] are rejected and resampled. If ฯƒ is very small relative to the range, most output concentrates near ฮผ. If ฯƒ is very large, the clamping at boundaries creates edge-piling artifacts.
When your browser supports the Web Crypto API (all modern browsers do), the tool uses crypto.getRandomValues() as the entropy source, which is cryptographically secure. The output is suitable for token generation, nonce creation, and unbiased sampling. On legacy browsers without crypto support, the fallback is Math.random(), which is NOT cryptographically secure and should not be used for security-sensitive applications.
Step defines the minimum spacing between valid values. A step of 0.5 with range [0, 10] produces candidates {0, 0.5, 1.0, 1.5, ..., 10.0}. The decimal places setting controls display formatting only - it does not override step constraints. If step is 1 but decimals is set to 2, output shows "7.00" not "7.34". For true decimal randomness, set step to match your desired precision (e.g., step = 0.01 for cent-level values).
The generator caps output at 100,000 numbers. For uniform non-unique generation, this completes in under 100ms on modern hardware. Unique generation with a large pool may take longer due to Fisher-Yates shuffle over the full pool array. If the pool array would exceed 10 million entries (e.g., range [0, 10000000] with step 1 and unique enabled), the tool switches to a Set-based rejection sampling method that uses less memory. A progress indicator appears for operations exceeding 200ms.
Yes. In Weighted mode, you define up to 5 sub-ranges with relative weights. For example: [1-10] weight 3, [11-50] weight 1. The tool normalizes weights into probabilities (75% and 25% respectively), selects a sub-range via CDF lookup, then generates uniformly within that sub-range. This is useful for simulating real-world distributions like income brackets or scoring curves where certain ranges should appear more frequently.