XConvert
Downloads
Pricing

Generate Random Numbers Online

Create random numbers instantly with a simple online generator that runs in your browser for quick, copy-ready results.

Range
Distribution & output
Generated numbers10 numbers · lines

How to Generate Random Numbers Online

  1. Set Min and Max: Enter the lower and upper bounds of your range — any real numbers, positive or negative. Default is 1 to 100. Endpoints are inclusive (a min/max of 1/100 can produce both 1 and 100).
  2. Choose Integers or Floats: Tick "Integers only" for whole numbers (the default), or untick to get 4-decimal floats. Floats are useful for Monte Carlo sims, weighted samples, or test fixtures.
  3. Pick Distribution and Count: Switch Distribution between Uniform (every value equally likely), Normal (Gaussian — mean = midpoint, std = range/6, ~99.7% of draws fall in range), or Exponential (decreasing — clusters near the minimum). Enter Count from 1 to 100,000.
  4. Generate and Copy: Choose Output format — One per line, CSV, or JSON array — then hit Regenerate and Copy. Numbers are generated in your browser tab using Math.random(); nothing is uploaded, nothing logged.

Why Generate Random Numbers?

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.

  • Test fixtures and sample data — Generate 10,000 numbers as a JSON array, paste straight into a unit test or seed file. CSV mode drops into Excel / Google Sheets in one paste.
  • Lottery picks, raffles, and giveaways — Set range 1–50, count 6, integers, Uniform — instant draw. For prize-money giveaways consider a publicly verifiable source like drand so winners can audit the result.
  • Statistical sampling — Pull a random subset of row IDs for a sample audit or A/B sanity check. Use Normal distribution to simulate measurement noise around a mean.
  • Game design and dice — Roll any-sided dice (1–20, 1–6, 1–100) by setting min/max and count. Floats are handy for procedural generation seeds.
  • Classroom and meeting tools — Cold-call a student (range = roster size), pick a presentation order, draw teams. The "one per line" format reads cleanly when projected.
  • Quick-and-dirty Monte Carlo — Sample 10,000 uniform draws to estimate integrals or test a strategy. For research-grade work, fall back to NumPy or Python's random with a fixed seed for reproducibility.

Uniform vs Normal vs Exponential — When to Pick Each

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.

Pseudo-Random vs Cryptographically-Secure — What Powers This Tool

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.

Frequently Asked Questions

Are these numbers truly random?

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).

Why shouldn't I use 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.

Does this tool have modulo bias?

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.

Are the endpoints inclusive or exclusive?

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).

How does the Normal distribution stay inside my range?

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.

Can I generate numbers without duplicates (no-repeat draws)?

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.

Can I seed it for reproducible output?

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.

Is there a maximum count I can generate?

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.

Can I generate negative numbers and decimals?

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.

What if I need provably fair randomness for a public draw?

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.

Related Generate tools
Nanoid GeneratorUlid GeneratorKsuid GeneratorFake Name GeneratorFake Email GeneratorFake Address GeneratorFake Phone GeneratorRandom Ip

Image Tools

Image CompressorCompress JPEGCompress PNGCompress GIFCompress WebPImage ConverterJPG ConverterImage Resizer

Video Tools

Video CompressorCompress MP4MP4 to GIFVideo to GIFVideo ConverterMP4 ConverterVideo Cutter

Audio Tools

Audio CompressorCompress MP3Compress WAVAudio ConverterMP3 ConverterFLAC to MP3Audio Cutter

Document Tools

Compress PDFMerge Images to PDFSplit PDFPDF to JPGUnzip FilesRAR Extractor
© 2026 XConvert.com. All Rights Reserved.
About UsPrivacy PolicyTerms of ServiceContactHelp Us Grow