CruxDevCruxDev Tools Prompts
finance Utility • Zero-Server Privacy • 100% Client-Side

Random Number Generator

Generate random numbers in any range with optional no-duplicates — for draws, games, and sampling.

Overview

A random number picker for any integer range: draw one number or up to a hundred, with an optional no-duplicates mode for raffle-style draws. Numbers appear as tiles you can read out or transcribe, and the whole thing runs on the browser's built-in random source with no server involvement.

How It Works

Set the minimum and maximum of your range, choose how many numbers to generate (1 to 100), and decide whether duplicates are allowed. Press Generate and the results appear as large tiles. In no-duplicates mode the tool redraws whenever it picks a value it has already produced, and it warns you up front if the range is too small to supply the count you asked for — for example 6 unique numbers from a range of 5.

Step-by-Step Usage Guide

  1. Enter the minimum and maximum of your range.
  2. Choose how many numbers you need.
  3. Tick 'No duplicates' for raffle-style draws.
  4. Press Generate and read the tiles; press again for a fresh draw.

Technical Specifications & Standards

The generator uses JavaScript's Math.random(), which produces a uniform value in the half-open interval from 0 to 1 from the engine's pseudo-random number generator; the code maps it into your integer range as lo + floor(random × range) and automatically swaps min and max if you enter them the wrong way round. Uniqueness is enforced by rejection sampling with a Set — keep drawing until the requested count of distinct values is reached — which is fine for modest counts; the pre-flight range check prevents the pathological case where the loop cannot complete. Understand what uniform means here: every integer in the range is equally likely on each draw, and there is no memory of previous draws unless the unique box is ticked — past results do not make a number more or less likely next time. Math.random is not cryptographically secure, so these numbers suit games, picks, and demos, not lotteries involving real money, cryptography, or adversarial participants.

Targeted Use Cases

  • Drawing winners for a small giveaway among numbered entries.
  • Picking random practice questions or flashcard indices.
  • Generating dice rolls, random samples, or test data for a spreadsheet.
  • Assigning random order for presentations or turn-taking in a group.

Notes & Gotchas

  • Tick no-duplicates only when repeats would invalidate the draw, such as raffles.
  • Make sure the range has at least as many values as the count you request in unique mode.
  • Use it for games and picks — for anything with real stakes or security implications use a cryptographic source.
  • Note the numbers down immediately; results are not stored and disappear on the next draw.

Frequently Asked Questions

Is Math.random() fair?

It is uniform: each integer in the range is equally likely per draw, and the mapping used here avoids skew for typical ranges. However it is a pseudo-random generator, not a cryptographic one — perfectly fine for picks and games, not for security or real-money lotteries.

How does no-duplicates mode work?

The tool keeps a set of values already drawn and redraws whenever a repeat appears, until it has the requested count. It checks in advance that the range contains enough distinct values, and warns you when it does not.

Can I generate decimals or weighted numbers?

No. The tool draws uniform integers in your range only. For decimals or weighted probabilities you would need a different tool or a small script.

Are previous draws remembered?

Only within the current result display, which is replaced on the next Generate press. Nothing is stored between sessions, and past draws never influence future ones.