Skip to content

Random number generator

Say from which number to which, then draw one number or several.

Guide and details

Set the range, draw. Both ends are included and every number in the range has the same chance.

Ranges, quantities and repeats

Type the lowest and the highest number you will accept. Both are included, and they can be negative. Ask for up to 1,000 numbers in one draw.

“No repeated numbers” makes the draw behave like numbered balls taken from a bag: once a number is out, it cannot come out again. That is the setting for raffle tickets and lottery picks. Untick it for independent draws, such as simulating a die that is not in the dice roller.

Why “random modulo n” is not good enough

The quick way to get a number from 1 to 100 is to take any random number, divide by 100 and keep the remainder. It is also slightly unfair. Take a random byte, which runs from 0 to 255: the remainders 0 to 55 can each be produced by three different bytes, and the remainders 56 to 99 by only two. The first group comes up half as often again as the second.

This generator draws 53 random bits at a time and rejects any value that falls in the incomplete last stretch, then draws again. What remains divides evenly, so every number in your range has exactly the same chance.

Where the randomness comes from

From crypto.getRandomValues, part of the Web Crypto API that every current browser ships. It is fed by the operating system’s entropy pool and is designed so that seeing past output does not help to predict the next. The older Math.random gives no such guarantee and is not used anywhere on this site.

Drawing people rather than numbers? Paste the names into the random name picker, which also gives you a receipt.

Why use Choose Tools

  • One source of randomness

    Every draw calls crypto.getRandomValues and throws away the values that would cause modulo bias. A test fails if Math.random ever appears in the source.

  • The result comes first

    The wheel, the coin and the dice pick the outcome before they move. The animation always has the same length and only shows what was drawn.

  • A receipt you can recompute

    Wheel and name-picker winners are derived from a 256-bit seed with SHA-256. The Verify page repeats the calculation and compares.

  • Lists stay on your device

    They are kept in local storage. Shared links carry the list after the #, which browsers do not send to servers. There is no account.

  • Quiet by default

    Sound is off until you turn it on, and with “reduce motion” set in your system the result appears with no animation.

Questions and answers

Are both ends of the range included?

Yes. From 1 to 100 can return 1, 100 and everything between them.

Can I use it to pick lottery numbers?

Yes. Set the range of the game, the quantity of numbers and keep “No repeated numbers” ticked. The draw cannot improve your odds of winning: every combination is as likely as any other.

Is this true randomness or pseudo-randomness?

It is a cryptographically secure generator: an algorithm seeded with unpredictable data collected by the operating system. Its output cannot be predicted from earlier results, which is what matters for a draw.

Can the range include negative numbers?

Yes, any whole numbers from minus one billion to one billion.