Number Generator - Random Integers in Any Range

Generate random integers in a chosen minimum and maximum range, with or without repeats. The Number Generator uses crypto.getRandomValues in the browser.

Random results are generated in your browser with crypto.getRandomValues(). Nothing is sent to a server.

01 Generator

    The Number Generator draws random integers inside a chosen minimum and maximum, with a fixed count and an option to allow or forbid repeated values. Set the range and how many numbers to return, and the tool fills the result list instantly using a cryptographically fair random source in the browser.

    Random integer generation is the core of raffles, lottery-style picks, classroom exercises, dice simulations and any situation calling for a fair, unpredictable number from a defined range.

    Generate random numbers in a range

    Concept diagram: Inputs leads to Generate random numbers in a range leads to ResultInputsGenerate random numbersin a rangeResult
    Generate random numbers in a range.

    Enter a minimum, a maximum, and a count, and the Number Generator returns that many integers drawn from the inclusive range between minimum and maximum. Defaults open at 1 through 100 with five values returned.

    Minimum and maximum must both be whole numbers, with maximum at least as large as minimum, and count must be a whole number from 1 through 1,000.

    Inclusive bounds mean the maximum value itself is reachable in the draw, which matters for a raffle or lottery labeled "1 through 100": the range must be set with maximum at exactly 100, not 99, for the labeling to match the actual draw.

    Choose whether repeats are allowed

    Concept diagram: Inputs leads to whether repeats are allowed leads to ResultInputswhether repeats areallowedResult
    Choose whether repeats are allowed.

    Setting unique to Yes draws without replacement: the generator builds every integer in the range, shuffles that full pool using a fair shuffle algorithm, and returns the first count entries from the shuffled result. If the requested count exceeds the total size of the range, generation stops with an error rather than silently producing duplicate values.

    Setting unique to No allows the same integer to appear more than once across the returned list, since each value drawn is an independent, fresh random pick from the full range. Use unique Yes for raffle tickets, seating assignments or any situation where the same value appearing twice would be a problem. Use unique No for independent repeated rolls of the same range, such as simulating multiple dice throws.

    Simulate a die roll or run a raffle

    Concept diagram: Inputs leads to Simulate a die roll or run a raffle leads to ResultInputsSimulate a die roll orrun a raffleResult
    Simulate a die roll or run a raffle.

    For a single six-sided die face, set minimum to 1, maximum to 6, count to 1, and unique to No; each press of generate returns one independent face.

    For two dice that may show doubles, keep unique set to No and set count to 2, so both positions draw independently from the same 1-through-6 range; setting unique to Yes with count 2 would incorrectly forbid doubles, which is not how real dice behave.

    For a raffle, set minimum to 1, maximum to the total number of tickets sold, unique to Yes, and count to the number of prizes being awarded. The generator returns that many distinct ticket numbers in shuffle order; the first number listed can be treated as first prize if the prizes are ranked.

    Verify the randomness is fair

    Concept diagram: Inputs leads to Verify randomness is fair leads to ResultInputsVerify randomness isfairResult
    Verify the randomness is fair.

    Numbers come from a cryptographically secure random source built into the browser, which fills a buffer with random bytes and uses rejection sampling to avoid a subtle bias that a naive modulo approach can introduce when the range size does not divide evenly into the random source's range.

    This method does not rely on the standard, less rigorous pseudo-random function commonly used for casual purposes.

    Every generated value stays local to the browser and is not transmitted anywhere. There is no seed input for this tool, meaning each press produces an entirely fresh, non-reproducible draw rather than a repeatable sequence.

    Work through a probability example

    Process with 3 steps: Enter Work through a probability…; Read the main result; Check the breakdown1Enter Work through aprobability…2Read the main result3Check the breakdown
    Work through a probability example.

    Take minimum 1, maximum 10, count 3, with unique set to Yes. The pool contains ten integers. After a fair shuffle, any specific number, such as 7, has a 3-in-10 chance of appearing somewhere among the three drawn values, since three of the ten pool positions are being filled.

    With unique set to No instead, each of the three draws is fully independent, so the expected number of times a specific value like 7 appears across three draws is 3 × (1/10) = 0.3, and unlike the unique-Yes case, the same value could in principle appear more than once.

    Frequently asked questions

    How do you generate a random number in a range?

    Set a minimum and maximum value and a count, then generate. The tool draws that many integers from the inclusive range using a cryptographically fair random source.

    What does "unique" mean in this context?

    Unique set to Yes draws without replacement, guaranteeing no repeated value in the result. Unique set to No allows the same value to be drawn more than once, since each draw is independent.

    Can I simulate rolling dice with this tool?

    Yes. Set minimum to 1, maximum to 6 (or however many sides), count to the number of dice, and unique to No, since real dice rolls are independent and can show repeated values like doubles.

    Is the random number truly random?

    Numbers are drawn using a cryptographically secure random source built into the browser, with rejection sampling applied to avoid range-related bias, which is a stronger randomness guarantee than a simple pseudo-random function.

    What happens if I request more unique numbers than the range contains?

    The generator returns an error rather than inventing duplicate values, since a unique draw cannot return more distinct values than exist in the specified range.

    Are inclusive bounds important?

    Yes. Inclusive bounds mean the maximum value itself can be drawn. A range meant to run "1 through 100" must set the maximum to 100, not 99, or the top value would never appear.

    Does this tool store or transmit the generated numbers?

    No. All generation happens locally in the browser, and generated values are not sent to any server.

    Summary

    Generating a random number means setting a minimum, maximum and count, then drawing that many integers from the inclusive range using a cryptographically fair random source, with an option to allow or forbid repeated values.

    Unique draws suit raffles and ticket assignments, while non-unique draws suit independent repeated events like dice rolls, and every draw stays local to the browser without a reproducible seed.