Random Number Generator (Uniform & Gaussian)

Generate up to 50,000 uniform or Gaussian samples with Web Crypto, histogram, Q-Q preview, K-S statistic and CSV or JSON export.

Random Distribution Generator · Client runtimeSandboxed
Formatted results will render here in real time.

About this random number generator (uniform & gaussian)

Generate up to 50,000 uniform or Gaussian samples with Web Crypto, histogram, Q-Q preview, K-S statistic and CSV or JSON export Computes exact algebraic and numerical metrics directly in your browser using IEEE 754 precision without round-trip latency.

Formula & calculation mechanics

Evaluates statistical metrics, linear regression models, and probability distributions in compliance with NIST engineering statistics standards. Computes sample variance ($s^2 = \frac{1}{n-1}\sum (x_i - \bar{x})^2$) using Bessel's correction for unbiased estimation, alongside population variance. Normal distribution tools compute Z-scores ($z = (x - \mu)/\sigma$) and cumulative distribution functions (CDF) via the Gauss error function (erf). Evaluates Binomial ($P(X=k) = \binom{n}{k} p^k (1-p)^{n-k}$) and Poisson ($P(X=k) = \frac{\lambda^k e^{-\lambda}}{k!}$) discrete distributions.

Worked numerical calculation

Scenario: Load constant example

Sample input:

normal; n=3, μ=7, σ=0

Processing: Continuous K-S is unavailable when σ=0.

Illustrative output:

7, 7, 7; K-S: —

Domain range & precision boundaries

Count: integer 1–50000. μ: |μ| ≤ 1e100. σ: 0 or 1e-100–1e100. Decimal point and e notation, optional sign and surrounding spaces; at most 64 UTF-16 units per field. No fractions or thousands separators. Both distributions use μ and σ; uniform limits are μ ± √3σ. Binary64 approximations, not exact continuous Gaussian numbers or a hardware entropy certificate. Finite random resolution truncates Gaussian tails; rounding can merge values or erase a very small spread beside a large mean. σ=0 produces a constant. Sorting costs O(n log n); runtime depends on the device. Uses crypto.getRandomValues with bounded byte requests. If Web Crypto fails, generation stops with an error; there is no Math.random fallback. The browser supplies cryptographically strong pseudorandom bits; this tool does not inspect the operating-system entropy source. Samples are for simulations, not cryptographic keys. Computed locally in the browser; works offline after loading. No added calculation dependencies, external service, fee or usage quota.

Calculations in Random Number Generator (Uniform & Gaussian) use standard IEEE 754 precision or exact rational models. Verify significant accounting or tax figures with authoritative references.

In-browser calculation boundary

Formula calculations and numeric evaluations in Random Number Generator (Uniform & Gaussian) run synchronously in the browser JavaScript engine with zero server telemetry.

Mathematical formulas & precision standards

Mathematical constants, IEEE 754 floating-point standards, and numerical analysis specifications:

Random Number Generator (Uniform & Gaussian) verification · Audit standards

How to use it

  1. Choose the distribution and enter count, μ and σ.
  2. Generate and inspect the full list, histogram, Q-Q preview and K-S statistic.
  3. Download CSV or JSON to preserve the samples.

Frequently asked questions

What distributions and parameters are available?+

Count: integer 1–50000. μ: |μ| ≤ 1e100. σ: 0 or 1e-100–1e100.

How are the random values generated?+

U=(k+0.5)/2^52 for 52 random bits. Uniform: μ+σ√3(2U−1). Normal: μ+σ√(−2ln U₁) cos(2πU₂), using two independent draws (Box-Muller in polar coordinates). No user seed or reproducibility promise; download to preserve a run.

How should I interpret the charts and K-S statistic?+

All values contribute to at most 40 equal-width bins over the observed range; the last bin includes its upper edge. A constant sample has one bin. Exact bin edges and counts are available below. Up to 200 evenly spaced sorted ranks, including both endpoints; p=(rank−0.5)/n. The horizontal axis uses target quantiles and the vertical axis uses observed values on the same scale. The dashed line is y=x. This is a preview, not every point for large samples. D=max(i/n−F(xᵢ), F(xᵢ)−(i−1)/n) uses the supplied target parameters, not fitted sample parameters. The threshold √(ln(40)/(2n)) is a conservative finite-sample DKW bound at 5%, not an exact K-S p-value. It assumes independent continuous samples; floating-point ties disable the threshold. Normal CDF and quantiles are numerical approximations. A single sample neither certifies the generator nor proves a distribution.

What do downloads contain?+

CSV contains index,value with a header and CRLF lines. JSON includes the distribution, count, μ as mean, σ as sd and all values in original generation order. Exports preserve serialized binary64 values; charts round labels only. No data is uploaded.