Random numbers · Unbiased
Random number generator
Set the range, choose how many you need, and watch the digits roll into place. Nothing is uploaded — every number is drawn in your browser.
Press “Roll numbers” to generate
Range 1 – 100
Ideas
What people generate numbers for.
From raffle draws to classroom calls — anywhere a fair, visible range pick beats pulling names out of a hat.
Giveaways & draws
Pick a winner from a numbered list, a raffle ticket or a seat number.
Classroom & training
Call on a student at random, assign groups, or generate problem sets.
Sports & fantasy
Draft positions, jersey numbers, tie-breaker seeds and lottery-style pulls.
Games & puzzles
Random coordinates, dice substitutes, code-breaking digits and lock combinations.
Lottery & bingo
Draw numbers in a range with or without repeats, sorted for easy calling.
Design & A/B
Pick a variant number at random when both options are genuinely equal.
Method
No modulo bias, no server, no log.
A naive random generator skips some numbers at the top of a range. We use rejection sampling: any draw outside an exact multiple of the range size is discarded and replaced, so every value has precisely the same chance.
const range = max - min + 1;
const limit = Math.floor(2**32 / range) * range;
let value = crypto.getRandomValues(u32)[0];
while (value >= limit) { // reject the tail
value = crypto.getRandomValues(u32)[0];
}
return min + (value % range);FAQ
Random number questions.
How to pick numbers in Python, how random number generators actually work, and what this picker does with your range.
How to generate a random number in Python
Use the built-in random module. random.randint(1, 100) returns an integer between 1 and 100 inclusive, random.random() returns a float from 0 to 1, and random.choice(sequence) picks one item at random.
import random
print(random.randint(1, 100)) # e.g. 42
print(random.random()) # e.g. 0.7183...
print(random.choice(["heads", "tails"]))The same idea works for any range: swap the two bounds for whatever you need.
How to get a random number in Python
Pick the function that matches what you need:
random.randint(1, 10)— integer, both ends includedrandom.randrange(0, 100, 5)— integer on a steprandom.uniform(1.5, 9.5)— floating pointsecrets.randbelow(100)— cryptographically secure integer
Avoid random.random() when you actually need an integer, and reach for the secrets module whenever the number matters for security — tokens, passwords, lottery draws. Or just generate one in the browser →
How to make a random number generator in Python
Python already ships one — the random module is a Mersenne Twister — but building your own teaches you how they work. You need three ingredients: a seed, an arithmetic rule that scrambles it, and a modulo that keeps the result in range. A classic linear congruential generator looks like this:
class LCG:
def __init__(self, seed=1):
self.state = seed
def next_int(self):
self.state = (1103515245 * self.state + 12345) % (2 ** 31)
return self.state
rng = LCG(42)
print(rng.next_int()) # same sequence every run
print(rng.next_int())Change the seed and the whole sequence changes. For anything real, use random or secrets instead of rolling your own.