Random Number Generator
Pick random numbers in any range.
Show detailsHide details
Choose a minimum and maximum, decide how many numbers you need, and generate them instantly. Turn on 'no duplicates' when every number must be different — ideal for raffles, team draws, random sampling, or settling a decision fairly.
Loading calculator...
Generate a Random Number — The Quick Answer
Set the lowest and highest values you'll accept, choose how many numbers, and generate. The range is inclusive — both the minimum and maximum can come up — and every value in between is equally likely.
Shortcut
random integer = floor(random × (max − min + 1)) + min
Common ranges
| Use | Range | Setting |
|---|---|---|
| Coin flip | 0 to 1 | min 0, max 1 |
| Dice roll | 1 to 6 | min 1, max 6 |
| Percentage pick | 1 to 100 | min 1, max 100 |
| Raffle (50 tickets, 3 winners) | 1 to 50 | count 3, no duplicates |
This generator is 'pseudo-random' — it uses your browser's Math.random, which is excellent for everyday use but is not cryptographically secure. Don't use it for passwords, security tokens, or anything where the outcome must be unpredictable to an attacker or legally certified.
How It Works
The Method
How a random integer in a range is produced
Formula
random integer = floor( random() × (max − min + 1) ) + min
Variables
The source of randomness
The browser produces a random decimal between 0 (inclusive) and 1 (exclusive). Scaling it by the size of your range and adding the minimum maps it onto the whole numbers you asked for, each equally likely.
Inclusive range size
The '+ 1' makes both endpoints possible. For 1 to 6 there are 6 outcomes (not 5), so a fair die needs max − min + 1 = 6 equally likely values.
Unique mode
When uniqueness is on, each drawn number is removed from the pool so it can't appear again — like drawing names from a hat. This requires at least as many possible values as numbers requested.
Note: The result is uniform: within your range no number is favoured over another. Patterns you might notice in a short run (a repeat, a streak) are normal — true randomness often looks less 'even' than people expect.
Worked Example
Picking 3 unique winners from 50 raffle tickets
Set the range
Tickets are numbered 1 to 50, so minimum 1 and maximum 50 — 50 equally likely outcomes.
Set how many and uniqueness
Three winners, so count 3 with 'no duplicates' on, so nobody can win twice.
Generate
The tool draws three different numbers from 1–50, for example 7, 23, and 41 — each ticket equally likely.
Reference Guide
| unit | value | note |
|---|---|---|
| Coin flip | 0 or 1 | min 0, max 1 |
| Dice roll | 1 to 6 | min 1, max 6 |
| Lottery-style | 1 to 49 | count 6, no duplicates |
| Pick a winner | 1 to 100 | count 1 |
Key Features
Last updated: October 5, 2026

Creators
Computer Scientist & Developer Tools Author
Reviewers
Technical Reviewer
Table of Contents
Quick Facts
Privacy Guaranteed
Your data never leaves your browser. All calculations are 100% private.
Frequently Asked Questions
Is the minimum and maximum included in the result?
Yes — the range is inclusive at both ends. If you set 1 to 6, every value from 1 to 6 (including 1 and 6) is possible and equally likely, exactly like a fair six-sided die.
How do I pick several numbers with no repeats?
Turn on 'no duplicates' and set how many you need. The generator then draws without replacement, so each number appears at most once — perfect for raffles, team selection, or random sampling. You just need at least as many possible values as numbers requested.
Is this random number generator truly random?
It is pseudo-random: it uses your browser's built-in Math.random, which produces high-quality, uniformly distributed numbers that are indistinguishable from random for everyday purposes. It is not cryptographically secure, so it shouldn't be used for passwords, security keys, or outcomes that must be provably fair or tamper-proof.
Why did I get the same number twice (or a streak)?
With duplicates allowed, each pick is independent, so repeats and short streaks are completely normal — a run of random numbers often looks less evenly spread than people expect. If you need every result to differ, switch on 'no duplicates'.