# Random Number Generator

> Generate random integers or floats in any range. Bulk output, allow-repeats toggle, seeded mode for reproducible runs.

- URL: https://generate.now/random-number
- Category: data
- Price: free, no account required
- AI-powered: no
- Last updated: 2026-08-27

## What it does

A focused random number generator with the controls you actually need: range, count, integer vs float, decimal places, allow-repeats. Optional seed for reproducible output across runs — useful for fixtures and tests. Cryptographically random by default.

## When to use it

- Generate a list of unique IDs for a small test dataset
- Draw lottery or raffle picks (with a seed if you want auditability)
- Get a single random number in a range without firing up a REPL
- Sample N values from a distribution for quick experimentation

## Examples

### 100 × integers, 1-1000, no repeats

```
742, 18, 903, 256, 411, ...
```

Unique integers drawn from a 1000-wide range.

### 1 × float, 0-1, 6 decimals

```
0.418273
```

A single float, useful for quick sampling.

### 6 × integers, 1-49, no repeats

```
7, 19, 23, 31, 42, 45
```

Drawn without replacement, so no number appears twice.

### seed "launch-2026", 5 × integers, 1-100

```
63, 12, 88, 41, 27
```

The same seed returns this exact sequence every time, on any machine.

## Frequently asked questions

### Is this cryptographically random?

By default, yes — it uses window.crypto.getRandomValues. If you provide a seed, it switches to a deterministic PRNG (mulberry32) so the output is reproducible. Seeded mode is not suitable for security use.

### Why does 'no repeats' have an upper limit?

You can't draw more unique values than the range contains. The tool caps the count when no-repeats is on and the range is too small, and shows a hint when it does.

### What does the seed actually do?

It switches the generator from the browser's cryptographic source to a deterministic algorithm, so the same seed always produces the same sequence. That makes fixtures reproducible and test failures debuggable. The trade-off is that seeded output is predictable by design — never use it for anything security-sensitive.

### What is modulo bias and does this avoid it?

Taking a random byte modulo 10 gives 0–5 slightly more often than 6–9, because 256 doesn't divide evenly by 10. Over a large draw the skew is measurable. The generator uses rejection sampling — discarding values that fall in the uneven tail — so every value in your range is equally likely.

### Can I use this for a giveaway or prize draw?

Yes, and using a seed is worth considering: publish the seed beforehand, draw afterwards, and anyone can reproduce the result and confirm you didn't re-roll. A visible seed turns a trust-me draw into a verifiable one.

### Why not just use Math.random()?

It isn't cryptographically secure, its quality varies between engines, and you can't seed it — so it's simultaneously unsuitable for security and unsuitable for reproducible fixtures. This tool gives you a proper source for the first case and a seeded generator for the second.

## References

- [Crypto.getRandomValues()](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) — MDN Web Docs. The cryptographically secure generator used in secure mode.
- [Math.random()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) — MDN Web Docs. Why the standard PRNG must not be used for anything security-sensitive.
- [SP 800-90A Rev. 1](https://csrc.nist.gov/pubs/sp/800/90/a/r1/final) — NIST. Recommendation for random number generation using deterministic bit generators.

## Related tools

- [UUID Generator](https://generate.now/uuid): Generate UUIDs (v1, v4, v7, v8) in bulk, with format options and a validator. Cryptographically random by default.
- [PIN Generator](https://generate.now/pin): Generate 4, 6, or 8-digit PINs that avoid obvious patterns like 1234, 0000, or birthdays.
- [Test Credit Card Generator](https://generate.now/credit-card): Stripe-style test card numbers — successful charges, declines, 3DS challenges. Valid Luhn, never charges.
