Create random numbers instantly with a simple online generator that runs in your browser for quick, copy-ready results.
Math.random(); nothing is uploaded, nothing logged.A generator that lives in your browser tab is faster than writing a one-liner script and safer than pasting test data into someone else's API. Whether you're seeding a fixture, drawing names from a hat, or sampling a survey panel, having Uniform / Normal / Exponential one click away covers ~95% of practical needs without firing up Python or R.
random with a fixed seed for reproducibility.| Distribution | What it does | Use when | Don't use when |
|---|---|---|---|
| Uniform | Every value in [min, max] equally likely | Dice, lottery, raffles, simple sampling, test data | You expect a "typical" value with rare extremes |
| Normal (Gaussian) | Bell curve; ~68% within 1 std of midpoint, ~99.7% within 3 std | Simulating measurement noise, IQ-like scores, manufacturing tolerances | Range is hard-bounded with no central tendency |
| Exponential | Decreasing density — many values near min, few near max | Inter-arrival times, time-to-failure, server request gaps | You want symmetric or evenly-spread draws |
The xconvert implementation clamps Normal and Exponential draws into [min, max] (Normal uses up to 50 rejection-sampling attempts before clamping). For statistically rigorous work, prefer numpy.random.Generator or R's rnorm / rexp — they use deeper algorithms and let you fix a seed.
| Source | Algorithm | Predictable? | Use for |
|---|---|---|---|
Math.random() (this tool) |
xorshift128+ in V8 (Chrome/Edge/Node), similar in Firefox/Safari since 2016 | Yes — state can be recovered from a few outputs | Test data, games, dice, raffles, lessons |
crypto.getRandomValues() |
CSPRNG seeded from OS entropy (/dev/urandom, BCryptGenRandom, etc.) |
No — cryptographically unpredictable | Passwords, tokens, session IDs, keys, anything with a security boundary |
random.org |
Atmospheric noise (hardware) | No — physically random | Audited prize draws, scientific work needing true randomness |
| drand | Threshold BLS signatures from the League of Entropy | No — publicly verifiable, unbiasable | Provably-fair lotteries, on-chain randomness, public draws |
Math.random() is plenty for the use cases above, but it is not safe for security. Browsers warn explicitly — see MDN's Math.random page. If you need a secret, use our Password Generator or UUID Generator instead.
No — they are pseudo-random. The browser's Math.random() runs the xorshift128+ algorithm seeded with system entropy. The output passes the TestU01 statistical test suite and is fine for games, samples, fixtures, and casual draws, but it is not unpredictable to an attacker — given a handful of outputs, the internal state can be recovered. For truly unpredictable randomness, use window.crypto.getRandomValues() (cryptographic), random.org (atmospheric noise), or drand (publicly verifiable).
Math.random() for passwords or tokens?Because the algorithm is deterministic. V8 (Chrome / Edge / Node) and other engines use xorshift128+, which has 128 bits of state. Researchers have shown that from a small number of consecutive outputs an attacker can solve for the internal state and predict every future value. For anything security-sensitive — session IDs, password reset tokens, API keys, nonces — use crypto.getRandomValues() (a CSPRNG seeded from the OS) or a server-side library like Node's crypto.randomBytes. MDN flags Math.random as "non-cryptographic" in its own docs.
It is minor but technically present. We scale Math.random() (a float in [0, 1)) by (max - min) and round for integers — that's a small, mostly-uniform bias on the boundary values, smaller than what you'd get from a naive Math.floor(Math.random() * n). For statistical work on huge sample sizes you should use a library that does rejection sampling — pull a slightly-larger raw value, discard anything that would fall outside the clean range, and repeat. Node 19+ exposes crypto.randomInt(min, max) which is bias-free. Python's random.randint and secrets.randbelow also use rejection sampling internally.
Both min and max are inclusive. A range of 1 to 6 with Integers on can return 1, 2, 3, 4, 5, or 6 — exactly what you want for dice. With Integers off, the underlying float range is [min, max) (max excluded), but with 4-decimal rounding the chance of seeing the exact max value is vanishingly small. Note this differs from Python's random.randrange(min, max) (exclusive) but matches random.randint(min, max) (inclusive).
We sample using the Box–Muller transform with mean = (min + max) / 2 and standard deviation = (max - min) / 6 — so ~99.7% of draws fall inside [min, max] by the three-sigma rule. The remaining ~0.3% of out-of-range draws are resampled up to 50 times, then clamped to the boundary. That means the very edges are slightly over-represented compared to a true truncated Normal. For a statistically clean truncated Normal use SciPy's scipy.stats.truncnorm.
This generator allows duplicates by default — useful for dice rolls, where you actually want repeats. For a unique draw (lottery picks, raffle without replacement), generate roughly 2-3x the count you need, then de-duplicate with [...new Set(numbers)] in JS or paste into a spreadsheet and use =UNIQUE(). For a guaranteed unique set use random.org's Sequence Generator which shuffles the range without replacement.
No — Math.random() does not expose its seed, by design. JavaScript intentionally hides the seed so pages cannot predict each other's randomness. If you need reproducibility (unit tests, scientific reruns), use a seedable PRNG like seedrandom, mulberry32, or pcg-random in your own code. Node's crypto.randomFillSync is reproducible only if you supply the same buffer source.
Yes — the Count field is capped at 100,000 in the UI. Beyond that the browser starts to lag (mostly from rendering 100k lines of text, not the generation itself). For larger workloads, run the same algorithm in Node, Python, or directly in the browser console — Array.from({length: 1_000_000}, () => Math.random()) runs in well under a second.
Yes for both. Min and Max accept negative numbers (try -50 to 50). Untick "Integers only" to get floats rounded to 4 decimal places. If you need higher precision, use Math.random().toFixed(10) in the browser console, or NumPy's np.random.uniform(low, high, size) for double-precision work.
Math.random() and even crypto.getRandomValues() are not auditable by a third party — the user has to trust that you actually ran the code shown. For audited giveaways, contests, or on-chain lotteries use a publicly-verifiable source like drand (League of Entropy beacon, used by Filecoin), Chainlink VRF, or random.org's Signed Drawings which publish a signed certificate of the draw inputs and outputs. These let any third party re-derive the result from inputs you committed to in advance.