Web Crypto CSPRNGReviewed 29 Sep 2026Runs in your browser

Random Number Generator

Generate uniform random integers or decimals, normally-distributed (Gaussian) values, or a reproducible sequence from a seed — using your browser's cryptographically secure random source, with duplicate control and sorting.

Who wrote it

Written by Suhaib Hassan. Our methodology.

How the engine works

Integers, floats and Gaussian draws use crypto.getRandomValues (a CSPRNG) for true browser-sourced randomness; the seeded mode uses a deterministic PRNG (mulberry32) so the same seed always reproduces the same sequence.

Why we built it

Nothing leaves your browser — no numbers are logged or sent anywhere, and a seeded run is fully reproducible for testing.

Random integers

Presets
Configuration—
Result—
—

—

Mean of sample—
Source—

Sample distribution

Where each value falls in its range.

—

Step-by-step working

—

—

    How each mode generates numbers

    • Integer / Float: uses crypto.getRandomValues, the same cryptographically secure source browsers use for security tokens — far higher quality than Math.random().
    • Gaussian: combines two uniform CSPRNG draws with the Box–Muller transform to produce normally-distributed values with your chosen mean and standard deviation.
    • Seeded: uses the mulberry32 deterministic algorithm — the same seed always produces the same sequence, useful for reproducible tests and simulations (not for security).

    By Suhaib Hassan · Reviewed 29 September 2026 · How CalculatePilot verifies formulas →

    Sources

    • Box, G. E. P., & Muller, M. E. (1958). A note on the generation of random normal deviates. Annals of Mathematical Statistics 29(2), 610–611.
    • W3C (2017). Web Cryptography API — Crypto.getRandomValues() specification.

    Frequently asked questions

    Is this suitable for cryptographic keys?

    The Integer and Float modes draw from crypto.getRandomValues, the browser's cryptographically secure generator, so the raw randomness is suitable. For actual key material, use a dedicated cryptography library that handles encoding and key formats correctly — this tool is for general-purpose random numbers.

    What does "no duplicates" mean?

    It samples without replacement — like drawing lottery balls without putting them back — so every value in the output is distinct. It requires the range to contain at least as many values as you're requesting.

    Why use a seeded generator instead of true randomness?

    A seeded (deterministic) generator lets you reproduce the exact same "random" sequence again later — essential for debugging simulations, sharing reproducible examples, or writing tests with predictable output.

    How does the Box–Muller transform create a normal distribution?

    It takes two independent uniform random numbers and applies √(−2 ln u₁)·cos(2πu₂) (and a sine variant), which can be shown mathematically to produce exactly standard normal N(0,1) values — then scaled by σ and shifted by μ.

    Why is Math.random() not used here?

    Math.random() is not specified to be cryptographically secure and its algorithm varies by browser. crypto.getRandomValues() is a web standard specifically designed for unpredictable, high-quality randomness.

    Related calculators

    Continue with statistics.

    All Math Calculators

    Embed This Random Number Generator

    Free and responsive, and it runs in the visitor's browser. Branding removal from $7.99/month.

    <iframe src="https://www.calculatepilot.com/embed/random-number-generator.html" width="100%" height="560" loading="lazy" title="Random Number Generator"></iframe>
    For website owners

    Want this calculator on your own website?

    Embed it in one line of code. Keep it free with a small CalculatePilot attribution link, or go white-label: your brand, no attribution, one license for all your domains.

    • All 159 calculators, unlimited embeds
    • Works on WordPress, Webflow, Squarespace, Wix and plain HTML
    • Runs in your visitor's browser, so nothing is sent to a server
    • License key emailed automatically after checkout, cancel anytime
    $7.99 / month
    or $89.99 / year · white-label Pro
    Get the white-label license Embed free with attribution