Random · Integer ranges

Random Number Generator

Generate one or up to 1,000 secure random integers in an inclusive range, with optional no-repeat results.

Cryptographic randomness

Generate random integers

Web Crypto
Random result

Select a range, then generate.

Uses crypto.getRandomValues with rejection sampling. No seed or result leaves your browser.

Generate numbers in an inclusive range

Both endpoints are included. A minimum of 1 and maximum of 10 can produce any integer from 1 through 10. Choose a quantity up to 1,000 and optionally prevent repeated values.

The no-repeat option is sampling without replacement. It requires the range to contain at least as many distinct integers as the requested quantity.

Source of randomness

This tool uses the browser’s crypto.getRandomValues() interface rather than Math.random(). It obtains cryptographically strong random values from the operating system through the Web Crypto API.

To map those values into the requested range, the generator uses rejection sampling. Values in the uneven remainder above the largest complete multiple of the range size are discarded. This avoids the small modulo bias produced by simply calculating randomValue % range when the range does not divide evenly into 2³².

Appropriate uses

The generator is useful for:

  • Random ordering and classroom exercises
  • Games, simulations, and test data
  • Informal drawings where participants accept a browser-based process
  • Selecting unique positions or identifiers within a bounded range

Important limitations

Do not treat this page as a certified lottery, regulated gambling system, auditable public drawing, or reproducible scientific random stream. It does not provide a seed, public audit log, participant verification, or external entropy proof. Results exist only in the current browser and disappear when replaced or the page closes.

The available integer range is limited to at most 4,294,967,296 distinct values so the unbiased mapping can operate on one 32-bit Web Crypto value at a time.

Frequently asked questions

Can the minimum be negative?

Yes. Both limits may be negative, zero, or positive safe integers, provided the minimum is not greater than the maximum and the range stays within the supported size.

Why might numbers repeat?

Independent random draws can naturally repeat. Select “Do not repeat numbers” when each output must be unique.

Use the Password Generator when the output must be a secure password rather than a numeric draw.