HCODX/Random Number Generator
Crypto-secure · No bias · Bulk & unique

Random Number Generator

Generate one number or thousands in any integer range. Uses the browser's CSPRNG (crypto.getRandomValues) with rejection sampling so the distribution stays uniform — no modulo bias, no Math.random.

Range & count
Random numbers
Options
UUID generator
Count
0
Range
Sum
Status
Ready
Example

Ten unique integers between 1 and 100

Pick a min, a max, and a count. Optionally enforce uniqueness — the generator runs Fisher-Yates over the full range to avoid duplicates without bias.

Configuration
min: 1
max: 100
count: 10
unique: yes
Result
7
14
22
38
47
55
63
71
84
99
Use cases

What you'll use this for

Anywhere you need fair, repeatable, secure randomness — from raffles to test fixtures to load testing.

Raffles & giveaways

Draw winning numbers in front of an audience — the math is verifiably fair.

Test fixtures

Seed integration tests with reproducible-looking random IDs or quantities.

Sampling

Pick a random sample of customers, rows, or records to inspect.

Games & puzzles

Roll dice, shuffle decks, or pick puzzle seeds without rigging the result.

Step by step

How to generate random numbers

1

Set the range

Any signed integer range works — negative numbers are fine. Make sure min ≤ max.

2

Pick a count

1 for a single roll, hundreds or thousands for test data. Up to 10,000 per click.

3

Toggle unique / sort

Uniqueness requires count ≤ range size. Sorting is independent.

4

Copy or download

Use the action bar to copy as plain text or save a .txt file.

FAQ

Frequently asked questions

Yes. Numbers are produced with crypto.getRandomValues, the browser's CSPRNG. We do not use Math.random. Good enough for raffles, salts, and short keys.

Yes. The generator rejects modulo bias by drawing 32-bit values and discarding anything outside the largest multiple of the target range. Every value has the same probability.

From -2147483648 to 2147483647 (signed 32-bit). For larger ranges, generate in chunks or use a UUID instead.

The generator runs Fisher-Yates partial shuffle over the full range and takes the first N values. Memory cost is proportional to the range, so unique mode is best for ranges up to ~10⁶.

No — CSPRNGs are deliberately not seedable. If you need a reproducible sequence, use a pseudo-random library like seedrandom in your own code.

About

About random number generation

"Random" means very different things depending on context. For lottery-style draws, cryptography, and statistical sampling you want a uniform distribution backed by a cryptographically secure source. This tool gives you both:

How it works

  • The browser's crypto.getRandomValues fills a Uint32Array with high-entropy bytes from the OS.
  • Values outside the largest exact multiple of the target range are rejected and re-drawn (avoiding modulo bias).
  • For unique mode, a Fisher-Yates partial shuffle picks N distinct values without replacement.

When to use a different tool

  • Cryptographic keys — use bytes directly, not integers.
  • Probability simulations — bias-free floats from a library like random-js.
  • UUIDs — use our UUID v4 generator.
Related

Related tools