Random Number Generator Online — Free Cryptographic RNG

Generate cryptographically secure random integers within any min/max range. Bulk counts up to 1000, no-duplicate mode, sortable output. Powered by the Web Crypto API.

Set Min, Max, Count and click Generate.

What is a Random Number Generator?

A random number generator (RNG) produces unpredictable integers within a chosen range. The OpenFormatter tool uses your browser's crypto.getRandomValues() — a cryptographically secure pseudo-random number generator (CSPRNG) — to produce numbers suitable for tokens, lottery draws, simulations, and statistical sampling.

Unlike Math.random(), which is fine for animations but predictable, crypto.getRandomValues() is unpredictable enough for security-sensitive use. The generator runs entirely in your browser — no server, no logging, no rate limit.

How to generate random numbers — 4 steps

  1. Set the range. Enter Min and Max — both inclusive. Negative numbers are allowed.
  2. Set the count. 1 to 1000 numbers per generation.
  3. Pick options. Disable duplicates for unique draws (lottery, raffle), enable sort for ordered output, choose comma or newline separator.
  4. Generate and copy. Click Generate. The tool draws from the Web Crypto CSPRNG, applies your filters, and shows the result.

Sample output

Min: 1   Max: 100   Count: 10   Duplicates: off   Sort: on

8, 14, 23, 31, 45, 57, 68, 72, 89, 96

Web Crypto CSPRNG

Uses crypto.getRandomValues — the browser-native cryptographically secure RNG used for TLS, WebAuthn, and password managers.

Flexible Output

Custom min/max range, bulk up to 1000 numbers, optional no-duplicate mode, sortable, comma or newline separated.

Browser-Only

Numbers never leave your device. No server, no cookies, no logging — verify in DevTools Network tab.

Common use cases

  • check_circleDrawing lottery, raffle, and giveaway winners with verifiable randomness
  • check_circleGenerating test fixture data for unit and integration tests
  • check_circlePicking random sample IDs from large datasets for QA review
  • check_circleSimulating dice rolls, card shuffles, and other game mechanics
  • check_circleProducing anonymised user IDs for analytics and demos
  • check_circleSelecting random panel members or interview candidates fairly
  • check_circleGenerating random ports for local development services
  • check_circleCreating Monte Carlo simulation seeds (combined with a seedable PRNG)

CSPRNG vs Math.random — and why bias matters

Browsers expose two RNGs. Math.random() is a fast pseudo-random generator (V8 uses xorshift128+) that is fine for game animations but predictable from a small number of outputs — never use it for tokens or fair draws. crypto.getRandomValues() is a CSPRNG suitable for keys and security tokens. We use the latter. The mapping min + (n % range) introduces a tiny modulo bias for very large ranges (the high values of 2^32 are slightly less likely if range does not divide 2^32 cleanly), but the bias is statistically undetectable for any range below ~16 million — which covers every realistic application of this tool.

More secure generators

Need passwords, UUIDs, or hashes from the same Web Crypto stack? Try the rest of OpenFormatter's security toolkit.

Frequently Asked Questions

Is this random number generator cryptographically secure?

Yes. The tool uses the Web Crypto API — specifically crypto.getRandomValues(new Uint32Array(...)) — which is the browser-native CSPRNG. It is suitable for generating tokens, salts, lottery picks, and security-sensitive draws. It is not Math.random(), which is not cryptographically secure.

What is modulo bias and how does it affect very large ranges?

When you map a 32-bit random value into a smaller range using min + (n % range), some output values can be slightly more likely than others if the range does not divide evenly into 2^32. The bias is statistically negligible for ranges below ~2^24 but matters in cryptographic protocols. For lotteries, simulations, and dev/test work the bias is undetectable.

Can I generate random numbers without duplicates?

Yes — toggle "Allow duplicates" off. The tool keeps drawing fresh random values and discarding repeats until it has the requested count of unique numbers. The count must not exceed the size of the range (max − min + 1), otherwise no solution exists.

How fast is the generator?

Generating 1000 numbers takes well under a millisecond on modern hardware. The Web Crypto CSPRNG is implemented in native browser code and benchmarks at hundreds of millions of bytes per second. The bottleneck is usually rendering the result, not the randomness.

Can I seed the generator for reproducible output?

No. The Web Crypto API is intentionally unseedable — that is what makes it cryptographically secure. If you need reproducible pseudo-random sequences (for tests or simulations) use a seedable PRNG library such as seedrandom, or Math.random() with a custom seeded implementation.

What is the maximum range?

JavaScript safely handles integers up to 2^53 − 1 (Number.MAX_SAFE_INTEGER). The tool internally uses 32-bit unsigned integers for randomness, so ranges up to roughly 4 billion are perfect. For larger ranges, the modulo-bias section above applies and you should use BigInt-based RNG.

Can I generate floating-point numbers?

This tool generates integers only. To produce floats in [min, max), divide a 32-bit random by 2^32 and multiply by (max − min). The Web Crypto API does not expose a getRandomFloat function; use crypto.getRandomValues(new Uint32Array(1))[0] / 2**32 to build one.

How does this compare to Math.random()?

Math.random() is fast but uses an unspecified PRNG (xorshift128+ in V8). It is fine for animations and games but unsuitable for security tokens, lottery picks, or anything that an attacker might try to predict. crypto.getRandomValues is slower per call but unpredictable and the right choice for any non-trivial randomness.

Random Number Generator Online — Free Crypto RNG