Coin Flip Online

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

Rolls0
Generated0
Average—
Range size100
Last results

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.

range.tsuniform by construction
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 included
  • random.randrange(0, 100, 5) — integer on a step
  • random.uniform(1.5, 9.5) — floating point
  • secrets.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.

How do random number generators work?
There are two flavours. A pseudo-random number generator starts from a seed and pushes it through a deterministic formula, so the same seed always reproduces the same sequence — fast enough for games, simulations and on-screen coin flips. A true random generator measures physical noise such as electronic or thermal jitter instead. Browser crypto.getRandomValues() mixes operating-system entropy into a pseudo-random generator, which is why our coin can print the exact number that decided each toss.
Is this random number generator truly random?
It is cryptographically random. Every draw comes from crypto.getRandomValues() — the same source browsers use for secure sessions — and rejection sampling removes the modulo bias that naive generators suffer from, so the minimum and the maximum are exactly as likely as any number between them. The whole draw happens in your browser and nothing is logged.
Can I pick unique random numbers without repeats?
Yes. Turn on Unique only and the picker draws without replacement, so no value appears twice until every number in the range has been used — what you want for raffles, seat draws and group assignments. Sort results puts them in order before you copy them. Generate unique numbers →
How to text someone from a random number?
You cannot: mobile networks verify the sending number, and faking or randomly generating a sender ID is blocked — and illegal — in most countries. The practical alternatives are a second-number app such as Google Voice, TextNow or Burner, a privacy relay service, or simply sharing your own number with people you trust. Never use number tricks to impersonate someone.