What is a random number picker?
A random number picker (also called a random number generator, random integer generator, or RNG) is a tool that produces numbers — integers or decimals — from a defined range with equal probability. You specify the range (for example, 1 to 100), how many numbers to draw, and whether duplicates are allowed. The picker returns values drawn with uniform randomness, so no number in the range is more likely than any other.
Unlike a coin flip or a die roll, a random number picker works for any range. It's the general-purpose tool for situations where you need an unpredictable number: rolling dice in a tabletop game, drawing lottery numbers, generating test data for a spreadsheet, picking a random PIN code, or running a statistical simulation.
This tool has three dedicated modes for the most common scenarios:
- Range mode — pick integers or decimals between any two numbers, with optional unique constraint and sorting.
- Dice mode — roll standard tabletop dice (d4, d6, d8, d10, d12, d20, d100) with animated 3D dice, click-to-reroll individual dice, lock-to-keep, modifiers, and dice notation parsing.
- Lottery mode — draw unique sorted lottery numbers with real-world presets like Powerball and 6/49, plus an optional bonus ball.
💡 Why use a dedicated random number picker? It's tempting to close your eyes and stab at a spreadsheet or "randomly" think of a number. Both are biased — humans are notoriously bad at producing randomness, and most people unconsciously avoid extremes and repeat recent picks. A dedicated picker using a cryptographic RNG gives you true uniform randomness without any of those biases.
How to use the random number picker
- Pick a mode. Choose Range for arbitrary numbers, Dice for animated 3D tabletop dice, or Lottery for unique sorted draws.
- Set your parameters. In Range mode, enter minimum, maximum, count, and whether duplicates are allowed. In Dice mode, pick a die type and count. In Lottery mode, pick a preset or set custom K and N values.
- Optional: apply a preset. Quick-start buttons load common configurations — coin flip, phone area code, Powerball, d20, and more.
- Click Pick (or press Enter). Numbers appear instantly. In Dice mode you see each die physically tumble and settle.
- Copy or export. Copy as plain text, comma-separated, or CSV. The pick history is saved locally and downloadable as a CSV file.
How to roll dice online
The Dice mode is a full 3D dice roller for tabletop games. Here's the exact workflow:
- Click the Dice tab at the top of the tool.
- Choose your die type — d4, d6, d8, d10, d12, d20, or d100. The d6 is rendered as a real 3D cube with pips; the other dice use distinct polyhedral shapes.
- Enter how many dice you want to roll (up to 100).
- Optionally enter a modifier like
+3or−1. The final total will include it. - Or type dice notation like
3d6+2in the notation field and click Apply to load all settings at once. - Click Roll. The dice tumble, spin, and settle on their final values. A large total appears below, with automatic crit detection (NAT 20 for a d20, MAX ROLL, MIN ROLL, etc.).
- After settling, click any individual die to reroll just that one. Click the 🔓 lock icon on a die to keep its value — locked dice turn green and are protected from rerolls.
- Click Roll all (or Roll unlocked when any dice are locked) to reroll every unlocked die at once.
💡 Yahtzee example. Roll 5d6. If you get three sixes, click the 🔓 lock icon on those three dice. Click Roll all to reroll the two unlocked dice. Repeat up to three times — exactly like playing at a real table.
💡 D&D attack roll example. Set die type to d20, count 1. Roll. If you roll a 20, a green NAT 20 badge appears. If you roll a 1, a red CRITICAL FAIL badge appears.
How to pick a random number between 1 and 100
This is the most common single use of a random number picker, so here is the exact click path:
- Make sure Range mode is selected (the default).
- Set Minimum to
1and Maximum to100. - Leave Number type as Whole numbers (integers).
- Set How many numbers to
1. - Click Pick or press Enter.
The tool returns one integer between 1 and 100 inclusive. Every number has exactly the same probability — 1/100 = 1% — because the picker uses cryptographically secure randomness with rejection sampling to eliminate modulo bias.
The three modes explained
| Mode | What it produces | Options | Best for |
|---|---|---|---|
| Range | Integers or decimals in any [min, max] | Type · Count · Unique · Sort | PINs, IDs, test data, simulations, coin flips |
| Dice | 3D animated polyhedral dice rolls | d4 – d100 · Count · Modifier · Notation · Click-to-reroll · Lock | D&D, Pathfinder, Yahtzee, poker dice, teaching probability |
| Lottery | Unique, sorted lottery draws | K from N · Optional bonus | Powerball, Mega Millions, 6/49, casual lottery play |
Range mode — any integer or decimal
Range mode is the general-purpose picker. You specify a minimum and a maximum, and the tool returns one or more numbers uniformly distributed in that range. Two optional settings change the behaviour:
- No duplicates — draws without replacement, so every number in the result is distinct. Standard for lotteries and drawing a bingo card.
- Sort — outputs the results in ascending or descending order rather than draw order. Useful for readability when picking many numbers.
Range mode supports four levels of decimal precision: whole numbers, 1 decimal place (like 3.7), 2 places (like 3.14), or 3 places (like 3.142). Decimal picks are internally scaled to integers so every possible value has equal probability — no rounding bias.
Dice mode — animated 3D dice rolls
Dice mode uses real 3D-rendered dice. The d6 is drawn as an actual cube with pips on six faces that visually rotate as it rolls. The other dice (d4, d8, d10, d12, d20, d100) use stylised SVG polyhedral shapes with a number on each face.
You can roll up to 100 dice at once (visual display caps at 12 dice for readability, with the full list still shown in the tiles below).
Features unique to this dice roller:
- Click any die to reroll just that one die — the animation runs independently and the total updates live.
- Click the lock icon (top-right of each die) to lock its value. Locked dice turn green and are excluded from Roll all.
- Dice notation input — type
4d6+3,2d20,1d100-5, and click Apply to configure everything at once. - Modifier — add or subtract a flat value from the total (e.g.
+3for a damage bonus). - Crit detection — NAT 20 on a d20 (green), CRITICAL FAIL on a d20 roll of 1 (red), MAX ROLL on any other die, MIN ROLL on any other die roll of 1.
Lottery mode — unique sorted draws
Lottery mode is a specialized Range mode with two constraints always on: numbers are unique (drawn without replacement) and sorted ascending. That matches the way real lottery balls are drawn — no duplicates, always displayed in order.
Presets are included for the most popular lotteries worldwide:
- Powerball — 5 numbers from 1–69 plus 1 Powerball from 1–26
- Mega Millions — 5 from 1–70 plus 1 Mega Ball from 1–25
- 6/49 — 6 from 1–49 (Canada Lotto, UK Lotto)
- 5/50 — 5 from 1–50 (EuroMillions-style)
- 7/39 — 7 from 1–39 (some state lotteries)
- Pick 3 — 3 from 1–10
Dice notation explained — what does 3d6 mean?
Tabletop games use a compact notation called XdY (sometimes written NdM):
- X = how many dice to roll
- Y = how many sides each die has
So 3d6 means "roll three six-sided dice and add them up" — the classic damage roll for a longsword in Dungeons & Dragons. 1d20 means "roll one twenty-sided die" — the standard attack roll. You can also add a modifier: 4d6+3 means "roll four d6, add them, then add 3."
| Notation | Means | Min–max result | Common use |
|---|---|---|---|
| 1d4 | One four-sided die | 1–4 | Dagger damage |
| 1d6 | One six-sided die | 1–6 | Short sword damage, fireball damage per level |
| 2d6 | Two six-sided dice added | 2–12 | Greatsword damage in some editions |
| 3d6 | Three six-sided dice added | 3–18 | Ability scores in classic D&D |
| 4d6+3 | Four d6 plus 3 | 7–27 | Enhanced ability score rolls |
| 8d6 | Eight six-sided dice added | 8–48 | Fireball damage at higher levels |
| 1d20 | One twenty-sided die | 1–20 | Attack rolls, saving throws, skill checks |
| 1d100 | One hundred-sided die | 1–100 | Percentile rolls, random tables |
💡 In this tool, type the notation into the dice panel's Dice notation field and click Apply — or set the die type and count manually. Either way works.
How the randomness actually works
Not all "random number generators" are equal. There are two main classes:
- PRNGs (pseudo-random number generators) — algorithms like JavaScript's
Math.random(). They produce sequences that look random but are entirely determined by an internal seed. If an attacker can guess the seed, they can predict every "random" number that follows. - CSPRNGs (cryptographically secure PRNGs) — algorithms designed so that even knowing the internal state of the system, an outside observer cannot predict future outputs. The browser's Web Crypto API exposes one of these via
crypto.getRandomValues().
This picker uses crypto.getRandomValues() — the same platform API used for password generation, session tokens, and cryptographic key material. Every call pulls fresh entropy from the operating system: hardware timing jitter, interrupt timing, and device noise.
There's one subtlety that most random pickers get wrong: modulo bias. If you naively compute randomUint32() % rangeSize, the low values of the range are slightly more likely than the high values whenever rangeSize doesn't divide 2³² exactly. This picker uses rejection sampling to eliminate the bias entirely.
Uniform distribution — and what people get wrong about it
Uniform distribution means every outcome has the same probability. In a fair d6 roll, every face is 1/6. In a 1–100 pick, every number is 1/100.
But uniform probability doesn't mean "evenly spread over time". If you flip a fair coin 100 times, you do not get exactly 50 heads and 50 tails. You get something close to 50 — typically between 40 and 60 — but not exact. The deviation is not a sign of bias; it's a mathematical property of randomness.
This is why gambler's fallacy is one of the most common mistakes in thinking about random numbers. If a fair coin just landed heads five times in a row, the next flip is still 50/50 — the coin has no memory.
⚠ Randomness doesn't mean "looks pattern-free". A truly random sequence will contain runs, clusters, and apparent patterns. If you pick 100 numbers from 1–100 and see one number appearing three times, that's not a bug — it's exactly what the math predicts.
Dice probability: what you actually roll
Tabletop dice produce two types of distributions:
- Single die (1d20, 1d100, etc.) — uniform. Every face is equally likely. A d20 average roll is 10.5, and the chance of rolling a natural 20 is exactly 5%.
- Multiple dice (3d6, 4d6, 8d6) — bell-shaped. Individual dice are uniform, but their sum clusters around the middle. 3d6 has an average of 10.5 and its most likely total is 10 or 11. The chance of rolling 18 (all sixes) is 1 in 216 — under half a percent.
That's why 3d6 is used for ability scores (mid-range outcomes are common) and 1d20 for attack rolls (any outcome equally likely).
Real-world uses
Tabletop gaming (D&D, Pathfinder, etc.)
Attack rolls (1d20), damage rolls (3d6), ability score generation (roll 4d6, drop lowest — reroll individual dice by clicking them), percentile checks (1d100), and everything in between. The animated 3D dice make it feel like physically rolling at a table.
Yahtzee, Farkle, and poker dice
Roll five dice, lock the ones you want to keep (they turn green), reroll the rest. Repeat up to three times. This is exactly how you play at a real table.
Lottery and raffle draws
Lottery mode matches the real formats of major lotteries. Generate a set of numbers for your own ticket, run a random drawing for a small raffle, or play a "what if" simulation.
Classroom and teaching
Assign student numbers, generate practice problems, or demonstrate probability. Rolling 100d6 and watching the bell curve of sums is a classic lesson made instant.
Statistics, sampling, and simulations
Draw random subsets of rows from a dataset, generate bootstrap samples, or run Monte Carlo simulations. Range mode with decimals covers continuous ranges.
PIN codes, IDs, and test data
Generate a random 4-digit PIN, a random 6-digit confirmation code, or a random user ID for testing. For real security purposes always generate credentials on the server.
Common mistakes
- Believing in "due" numbers. In a random draw, every number is equally likely every time. Independence is the whole point.
- Rerunning until you like the result. Every pick is a fresh uniform draw. Rerunning to get a particular outcome defeats the purpose.
- Using
Math.random()-based pickers for anything with stakes. Look for tools that explicitly say they usecrypto.getRandomValues(). - Forgetting to enable No duplicates when picking multiple values. Without it, the same number can be drawn twice in the same set.
- Confusing "random" with "fair-looking". A truly random draw of 10 numbers from 1–10 with replacement has a reasonable chance of containing a duplicate.
Limitations
- Randomness is generated client-side. For legally binding lottery or raffle draws that require an auditable third-party record, use a certified draw service.
- The visual dice stage caps at 12 dice for readability. The full roll supports up to 100 dice — all values are included in the total, in the tile list, and in the CSV export.
- Decimal precision is capped at 3 places.
- Dice mode uses standard polyhedral dice. Non-standard dice (d30, d66, exploding dice, etc.) require custom range configuration in Range mode.
Privacy and data storage
Everything runs in your browser. Your settings and pick history are stored locally in localStorage — they never leave your device. No account, no login, no server upload.
Frequently asked questions
How do I roll dice online?
Click the Dice tab, choose your die type (d4, d6, d8, d10, d12, d20, or d100), set how many dice to roll, optionally add a modifier like +3, and click Roll. The 3D dice animate as they tumble and settle on their final values. Every die uses cryptographically secure randomness.
Can I click dice to reroll them individually?
Yes. After the dice settle, click any individual die to reroll just that one. Lock dice you want to keep by clicking the lock icon on each die — locked dice turn green and are protected from rerolls. This is perfect for Yahtzee, poker dice, and D&D damage rerolls.
What is dice notation like 3d6+2?
XdY means roll X dice with Y sides each. 3d6 = roll three 6-sided dice and add them. 1d20 = roll one 20-sided die. 4d6+3 = roll four 6-sided dice, add them up, then add 3. Type the notation into the dice panel's notation field and click Apply to load it in one step.
What does a natural 20 look like in this tool?
When you roll 1d20 and the result is 20, a green NAT 20 badge appears next to the total. A roll of 1 on 1d20 shows a red CRITICAL FAIL badge. On other dice, a maximum roll shows MAX ROLL and a minimum roll shows MIN ROLL.
How do I pick a random number between 1 and 100?
Open Range mode, set Minimum to 1 and Maximum to 100, leave the number type as Whole numbers, set How many numbers to 1, and click Pick (or press Enter). Every number has exactly 1% probability.
Is the random number generator truly random?
Yes. The picker uses crypto.getRandomValues(), the browser's cryptographically secure random number generator, with rejection sampling to guarantee every number in the range has exactly equal probability — no modulo bias.
Can I pick multiple unique numbers at once?
Yes. Enable the No duplicates option and the picker draws distinct numbers without replacement.
Does the picker support decimal numbers?
Yes. Range mode offers Integer, 1 decimal place, 2 decimal places, and 3 decimal places.
What dice can I roll?
Dice mode supports the seven standard polyhedral dice: d4, d6, d8, d10, d12, d20, and d100. You can roll up to 100 dice at a time, click any die to reroll it individually, and lock dice you want to keep.
Does the picker support lottery draws like Powerball?
Yes. Lottery mode includes presets for Powerball, Mega Millions, 6/49, 5/50, 7/39, and Pick 3. All lottery picks are unique and sorted ascending.
Can the same number be picked twice?
By default, duplicates are allowed — each draw is independent. Enable No duplicates to draw without replacement.
Is this the same as Math.random()?
No. Math.random() returns predictable pseudo-random numbers. This picker uses crypto.getRandomValues() — the same platform API used for password generation and security tokens.
Why does my random draw contain duplicates?
Because each draw is independent — the picker has no memory. A 1–100 range with 20 picks has roughly an 86% chance of containing at least one duplicate. Enable No duplicates to draw without replacement.
Is my data saved?
Only in your browser. Settings and history are stored in localStorage so they survive a page reload. Nothing is uploaded.
Does the picker work offline?
Yes. Once the page has loaded, everything runs in your browser with no runtime network calls.
Related tools on AIToolsPros
Sources & methodology
- MDN Web Docs — Window.crypto.getRandomValues(): specification and security notes on the Web Crypto API.
- Fisher, R. A., and Yates, F. (1938). Statistical Tables for Biological, Agricultural and Medical Research. The Fisher–Yates shuffle algorithm used for unbiased multi-picks without replacement.
- Knuth, D. E. The Art of Computer Programming, Vol. 2 — analysis of rejection sampling for eliminating modulo bias in uniform integer selection.
- W3C Web Cryptography API Recommendation — normative reference for the platform randomness source used by this tool.