ΣCALCULATORWizard

🎲 Random Number Generator

Generate random numbers, roll any dice, pick lottery numbers, or create custom ranges. History saved, TXT export, works perfectly on mobile.

Quick Range Presets
Generates one integer in your chosen range (inclusive both ends)
Generate up to 200 numbers at once
Roll up to 12 dice of any type simultaneously. Shows individual rolls + total.

📜 Recent Results

No results yet — generate some numbers!

How Pseudorandom Number Generation Works

True randomness — in the mathematical sense — is impossible for a deterministic computer. What software produces instead is pseudorandomness: a sequence generated by a deterministic algorithm that is statistically indistinguishable from genuine randomness for practical purposes. The standard JavaScript Math.random() function uses an implementation of the xorshift128+ algorithm in most modern browsers. It seeds itself from system entropy sources (timing data, hardware events) when the page loads, producing a starting state that is effectively unpredictable for everyday use.

The generation formula for an integer in range [min, max] is: Math.floor(Math.random() × (max − min + 1)) + min. This maps the [0, 1) output of Math.random() uniformly across your requested range. Each integer has an equal probability of 1 / (max − min + 1). For most applications — games, raffles, random sampling, teaching — this level of randomness is entirely sufficient. Cryptographic applications (generating encryption keys, password salts) require a cryptographically secure PRNG from the Web Crypto API, which draws from OS-level entropy pools. This calculator is designed for practical everyday uses where crypto-strength is unnecessary.

The Five Modes and When to Use Each

Single Number is the simplest and most used mode. Set a minimum and maximum, get one integer. Perfect for: picking a random winner by number (assign each contestant a number, generate one), choosing a starting player in a board game, settling a dispute ("highest number goes first"), selecting a random chapter to read, or any situation requiring one unbiased choice. The result fills the screen large so it's clearly visible from a distance — useful in classroom settings where everyone needs to see the number.

Multiple Numbers generates a batch of integers at once with optional uniqueness and sorting. With "No Duplicates" enabled, the algorithm uses a Fisher-Yates shuffle on the available number pool — guaranteed uniform distribution without repetition. Use this for selecting multiple raffle winners (generate as many numbers as prizes), creating a randomized list of questions or tasks, randomizing the order of a to-do list, or generating a random test dataset. With sorting enabled, results appear in ascending order for easy cross-referencing against a numbered list of entries.

Dice Roller supports D4, D6, D8, D10, D12, D20, and D100 — the complete set of polyhedral dice used in tabletop RPGs. Roll up to 12 dice simultaneously. D6 results display as visual dice faces with classic dot patterns for immersion. All other die types show the number in a clean styled box. The total sum appears below the individual rolls, which is what Dungeons & Dragons and Pathfinder typically require: "roll 2D6 for damage" means sum two six-sided dice.

Lottery Picker includes Powerball, Mega Millions, EuroMillions, Lotto 6/49, and a fully custom lottery format. Main numbers are drawn without replacement from their pool, then sorted ascending — exactly how real lottery draws work. Bonus balls (Powerball, Mega Ball, Lucky Stars) are drawn from a separate pool independently. Results display as styled lottery balls for visual clarity, with bonus numbers in gold to distinguish them from main numbers. The custom lottery option lets you define any combination of main and bonus pick counts and ranges.

Custom Range adds two features unavailable in the other modes: negative number support and decimal output. Set your minimum to any negative integer for ranges like −50 to 50. Enable decimals to get results with four decimal places, which is useful for Monte Carlo simulations, probability experiments, or generating randomized fractional values for statistical sampling. Generate up to 200 numbers at once in custom mode.

Dice Types: A Complete Reference

The standard set of polyhedral dice used in tabletop games covers seven distinct shapes, each with specific use cases in game mechanics:

DieFacesShapeCommon Uses
D41–4TetrahedronDagger damage, healing word, low-damage spells
D61–6CubeStandard board games, ability score generation (4D6 drop lowest), hit dice for small classes
D81–8OctahedronLongsword/rapier damage, cleric hit dice, medium weapons
D101–10 (or 0–9)Pentagonal trapezohedronBarbarian hit dice, heavy crossbow, paired with another D10 for percentile
D121–12DodecahedronGreataxe damage, barbarian weapon, hit dice for barbarians
D201–20IcosahedronAttack rolls, saving throws, skill checks — the core mechanic of D&D 5e
D1001–100Percentile (two D10s)Wild magic surge tables, percentage-based skill checks, random encounter tables

Standard dice notation combines these: NdX means roll N dice with X sides each. 2d6 means two six-sided dice (result: 2–12). 3d8+5 means three eight-sided dice summed plus a fixed modifier of 5 (result: 8–29). 4d6 drop lowest (the classic ability score method) means roll four D6s and discard the lowest result, summing the remaining three (range: 3–18, mean around 12.24).

Lottery Math: Understanding the Odds

A random number generator cannot improve your odds of winning the lottery — no strategy can, because the draws are independent and uniformly random. However, understanding the mathematics reveals why some choices are strategically smarter despite having identical winning odds. The probability of winning Powerball's jackpot is 1 in 292,201,338. This is calculated using the combination formula C(69,5) × C(26,1) = 11,238,513 × 26. Every single combination of five main numbers plus one Powerball has exactly this probability.

Where strategy enters is in jackpot sharing. If your winning combination is also played by many other people, you split the prize. Combinations based on dates (birthdays, anniversaries) cluster heavily in the 1–31 range because months and days don't exceed 31. If you play numbers above 31, you don't increase your probability of winning, but if you do win, you're statistically less likely to share the jackpot with multiple other winners. A random number generator with a full range (1–69 for Powerball main numbers) distributes picks uniformly across the entire number space, naturally avoiding the birthday clustering problem.

Mega Millions odds are 1 in 302,575,350 (C(70,5) × C(25,1)). EuroMillions stands at 1 in 139,838,160. Lotto 6/49 at 1 in 13,983,816 is considerably better odds for a jackpot than the American lotteries, though the prizes are correspondingly smaller. All of these make buying multiple tickets marginally improve your absolute odds but not enough to overcome the house edge — lotteries return roughly 50 cents on every dollar in prize money.

Applications: Raffles, A/B Testing, and Sampling

Running a fair raffle with this tool is straightforward. Assign each entry a sequential number starting from 1. Note the total count. Generate one random number between 1 and the total. That number corresponds to the winner. For multiple prizes, switch to Multiple mode, enable No Duplicates, and generate as many numbers as there are prizes. The no-duplicates guarantee means each entrant can win at most once. Copy or export the results immediately for a transparent, auditable record of the draw.

A/B testing requires randomly assigning users to groups without bias. Generate a 1 or 2 for each user (1 = Group A, 2 = Group B) using Multiple mode with a range of 1–2. Over large samples this produces roughly equal group sizes. For more granular splits — 70% control, 30% treatment — generate numbers 1–100 and assign 1–70 to control and 71–100 to treatment.

In statistics, random sampling means every member of a population has an equal chance of being selected. Number your population 1 through N, generate the required sample size using Multiple mode with No Duplicates enabled to prevent any individual being selected twice. This produces a simple random sample meeting the assumptions of most inferential statistical tests. The Fisher-Yates shuffle algorithm used for unique selection is O(n) and produces provably uniform distributions across all possible samples.

Frequently Asked Questions

Is this a true random number generator?
It uses JavaScript's Math.random(), which is a cryptographically non-secure pseudorandom number generator — excellent for games, simulations, raffles, and everyday randomness, but not suitable for generating cryptographic keys or security tokens. For those purposes, the Web Crypto API's getRandomValues() provides cryptographically secure randomness. For all practical non-security uses, Math.random() passes every standard statistical test for randomness.
What does "No Duplicates" do and how does it work?
When enabled, each generated number appears at most once in the result set — like drawing names from a hat without replacement. The algorithm builds a pool of all integers in your range, then uses a Fisher-Yates shuffle to randomly extract the required count. This guarantees uniform distribution and true uniqueness. If you ask for more unique numbers than exist in the range (e.g., 15 unique numbers from 1–10), the calculator shows an error rather than silently failing.
How do I roll dice for Dungeons & Dragons?
Use Dice mode. Select the die type (D4, D6, D8, D10, D12, D20, or D100) and the number of dice. For "2D6" select 2 dice and D6 — the display shows each die individually plus the total. For advantage (roll twice, take higher), roll once, note the number, roll again, take the better result. For ability score generation (4D6 drop lowest), roll four D6s, mentally drop the lowest showing value, and add the remaining three.
Can I generate negative numbers or decimals?
Yes to both, in Custom mode. Set your minimum to any negative value for ranges like −100 to 100. Check "Include Decimals" to get results with four decimal places. This is useful for statistical simulations, Monte Carlo methods, or any application requiring continuous rather than integer values across a range that includes negative numbers.
How does the lottery number generator work?
Main numbers are drawn without replacement from their pool — exactly as real lottery machines work. The algorithm builds the full eligible number pool (e.g., 1–69 for Powerball main numbers), performs a Fisher-Yates shuffle to select the required count, then sorts them ascending. Bonus balls are drawn independently from a separate pool. Results are displayed as styled lottery balls with bonus numbers visually distinguished in gold.
How do I export or save my results?
Click "Export TXT" after generating to download a formatted text file with your mode settings, all results, timestamp, and attribution. The "Copy" button copies the result to your clipboard for pasting into any document. The Recent Results history panel shows your last 10 generations and persists until you click Clear or reload the page.
Can I use this for a raffle or giveaway?
Absolutely — it's well-suited for that. Assign each entry a sequential number starting at 1. Use Single mode to pick one winner, or Multiple mode with No Duplicates for multiple winners. Export the TXT result immediately for a transparent record showing the mode used, the range, and the exact numbers drawn. This export provides an auditable paper trail showing the draw was conducted fairly.