What is a random number generator?
A random number generator (RNG) is a tool that produces numbers with no predictable pattern — each result is independent of the ones before it, and every value in your chosen range has a fair chance of appearing. That simple idea turns out to be quietly essential to an enormous amount of modern life. Lotteries and raffles use random numbers to pick winners fairly. Scientists use them to sample participants and run experiments. Game designers use them to roll dice, deal cards and decide outcomes. Cryptographers use them to generate the keys that protect your messages and payments. Teachers use them to assign groups, and developers use them to build and test software. Whenever a decision needs to be impartial, unpredictable or representative, a random number generator is doing the work behind the scenes.
This online random number generator runs entirely in your web browser. There is nothing to install, no account to create and no cost. In its simplest form you set a minimum and a maximum, choose how many numbers you want, and press Generate — and a result appears instantly. Want a single number between 1 and 100 for a quick decision? Done. Need fifty unique numbers between 1 and 500 to seed a draw? One click. The tool handles positive numbers, negative numbers, decimals and very large integers, and it can produce a single value or hundreds of thousands at once, with the whole batch sorted, de-duplicated and ready to copy or export.
But it is far more than a single-purpose number picker. It is really a complete randomisation suite. A dedicated Lottery mode ships the real rules for Powerball, Mega Millions, EuroMillions, the UK National Lotto, Lotto 6/49 and others, drawing the correct count of main numbers plus any bonus balls — and you can define your own custom game too. A Dice mode rolls the full polyhedral set from D4 to D100 with realistic faces and understands tabletop notation like “3d6+2”. A Coin Flip mode tosses one coin or ten thousand and tracks the running percentage of heads and tails. A Picker mode chooses contest winners, raffle entries and random positions from a list you paste in, and a Simulation mode lets you run Monte Carlo experiments to explore probability for yourself.
Crucially, you get to choose how the randomness is produced. The default Standard mode uses your browser’s fast built-in generator, which is ideal for everyday picks, games and casual draws. Cryptographic mode switches to a CSPRNG backed by the Web Crypto API (crypto.getRandomValues), producing security-grade randomness suitable for PINs, tokens and any draw where unpredictability really matters. Seeded mode does the opposite of secrecy on purpose: by keying the generator with a seed value you provide, it reproduces the exact same sequence every time — invaluable for testing software, repeating an experiment, or running a giveaway where entrants need to be able to verify the result themselves.
Every set you generate comes with instant analysis. A statistics panel reports the minimum, maximum, sum, mean, median, mode, range and standard deviation, while a live histogram visualises how your numbers are distributed across the range so you can see at a glance whether they look uniform. You can copy results in a single click, export them as TXT, CSV, Excel, JSON or PDF, and keep an automatic local history of everything you have generated. Saved presets put your favourite ranges, dice sets and lottery games one tap away, and because all of this is stored locally in your browser using IndexedDB with a localStorage backup, it works offline and never leaves your device. There are no servers quietly logging the numbers you draw.
The tool is built to be fast, fair and friendly. It is fully keyboard-accessible — Enter generates, R regenerates, C copies and S saves — works on phones, tablets and desktops, supports a comfortable dark mode, and carries proper ARIA labelling for screen readers. Whether you are a teacher demonstrating probability to a class, a streamer running a fair giveaway, a developer seeding test data, a gamer rolling for initiative, a researcher sampling a population or simply someone who needs to pick a number, this is a professional-grade randomisation platform that happens to be completely free, completely private and instantly available in any modern browser.
How random numbers actually work
It helps to know that almost no “random” number on a computer is truly random in the physical sense. A classic computer is a deterministic machine: given the same inputs it produces the same outputs every time, which is the opposite of randomness. To bridge that gap, software relies on two different kinds of generator. The first is a pseudo-random number generator (PRNG): a clever mathematical formula that, starting from an internal value called the seed, produces a long sequence of numbers that pass statistical tests for randomness even though the whole sequence is completely determined by that starting seed. PRNGs are extremely fast and perfectly good for games, simulations, shuffling and everyday picks. Standard mode in this tool uses your browser’s built-in PRNG; Seeded mode uses a high-quality PRNG (an sfc32 generator keyed by a hash of your seed) so you can reproduce a sequence on demand.
The second kind is a cryptographically secure pseudo-random number generator (CSPRNG). It still runs in software, but it continuously mixes in genuine entropy gathered by your operating system from unpredictable physical events — the precise timing of keystrokes and interrupts, hardware noise, and dedicated random-number instructions in modern CPUs. The defining property of a CSPRNG is that its output is unpredictable even to an attacker who has seen every previous number it produced. That is exactly what you need when generating passwords, encryption keys, session tokens or any value whose predictability would be a security hole. Cryptographic mode in this tool calls the Web Crypto API’s crypto.getRandomValues, the same secure primitive browsers use under the hood for HTTPS.
Whichever source is used, turning a raw random value into a number in your range takes a little care. The generators here produce a floating-point value in the interval [0, 1); to get a whole number between your minimum and maximum, that value is scaled across the size of the range and floored, which maps it uniformly onto every possible outcome. For draws that must be unique, the tool does not simply keep guessing and rejecting duplicates when that would be slow — for a dense range it builds the full list of candidates and performs a partial Fisher–Yates shuffle, the gold-standard algorithm for an unbiased random ordering, then takes as many as you asked for. For a sparse draw (a handful of numbers from a billion) it uses set-based rejection sampling instead. These choices keep results both statistically fair and fast, even for very large batches.
The result is a generator you can actually reason about. If you need speed and convenience, Standard mode delivers it. If you need security, Cryptographic mode gives you unpredictable, CSPRNG-quality numbers without sending anything to a server. And if you need to prove a result was fair or reproduce it later, Seeded mode lets anyone with the same seed regenerate exactly the same numbers. Understanding which mode to reach for — and why — is the difference between a number that merely looks random and one that is fit for its purpose.
Pseudo-random vs cryptographic random: which should you use?
The single most important choice when generating random numbers is whether you need them to be unpredictable to an adversary. If the answer is no — you are rolling dice, shuffling a playlist, picking a colour, running a simulation or holding a casual draw — a pseudo-random generator is the right tool. It is faster, it is perfectly uniform, and its one “weakness”, that the sequence is determined by a seed, is irrelevant when nobody is trying to cheat. The overwhelming majority of everyday randomisation falls into this category, which is why Standard mode is the default here.
If the answer is yes — the value is a PIN, a one-time passcode, an access token, a password, an encryption key, or the outcome of a high-stakes draw where someone has a real incentive to predict or rig it — then you must use a cryptographically secure generator. A plain PRNG is dangerous in these situations precisely because it is predictable: an attacker who can observe or guess its internal state can forecast every future “random” value it will produce. A CSPRNG is designed so that this is computationally infeasible. The practical rule of thumb used by security engineers is simple: if randomness protects something, use a CSPRNG; otherwise a PRNG is fine. Cryptographic mode in this tool exists for exactly the first case.
Seeded randomness is a third, deliberately non-secret option that often gets confused with the other two. A seeded PRNG is reproducible by design: feed it the same seed and it replays the same sequence. That is a feature, not a flaw, when reproducibility is the goal. Software teams seed generators so that a failing test produces the same “random” data every run and can be debugged. Scientists seed simulations so peers can reproduce their results exactly. And a transparent giveaway can publish its seed in advance so entrants are able to verify, after the fact, that the announced winners really were the output of a fair draw. The table below summarises when to reach for each.
How to use the random number generator
Start by choosing the mode that matches what you are doing. For plain numbers — a lucky pick, a sample, a range of values — stay on the Numbers tab. Switch to Lottery for quick-pick lottery lines, Dice for tabletop and board games, Coin for yes/no decisions and probability demos, Picker to choose winners or positions from a list, and Simulate to run probability experiments.
On the Numbers tab, set your minimum and maximum, type how many numbers you want, and choose whether they should be whole numbers or decimals (with the number of decimal places you need). Toggle “unique” on if no value should repeat — useful for raffles and sampling — or off if duplicates are allowed, which is what you want for simulations. Pick a sort order if you would like the output ascending or descending, then press Generate or hit the Enter key. Your numbers appear immediately, large and legible, alongside live statistics.
To change the randomness source, open Settings and choose Standard for fast everyday picks, Cryptographic for security-grade numbers, or Seeded to reproduce a sequence — and enter your seed text in the latter case. The chosen source applies across every mode, so a seeded lottery draw or a cryptographic PIN works exactly as you would expect. Use the quick presets (1–10, 1–100, dice, lottery games, PIN lengths) to skip straight to common configurations.
Once you have a result, you have plenty of options. Click Copy to put the numbers on your clipboard, or open the Export menu to download them as TXT, CSV, Excel, JSON or PDF. Open the Statistics and Chart panels to study the distribution. Save the current configuration as a preset so you can re-run it instantly, and check the History panel to revisit or restore any earlier generation. Everything is stored locally, so your presets and history are waiting for you the next time you open the tool — even offline.
Generating lottery and lucky numbers
The Lottery mode is built around the real rules of the world’s biggest games, so the numbers it produces are valid lines you could actually play. Choose Powerball and it draws five unique main numbers from 1–69 plus a single Powerball from a separate 1–26 pool. Mega Millions draws five from 1–70 plus a Mega Ball from 1–25. EuroMillions draws five from 1–50 plus two Lucky Stars from 1–12. There are presets for the UK National Lotto (6 from 59), Canada’s Lotto 6/49, Italy’s SuperEnalotto and Australia’s Powerball, and a fully custom option where you set your own pool sizes and ball counts. You can generate a single line or a whole batch of quick-picks at once, and each line’s main numbers come back sorted, just as they are drawn.
It is worth being clear about what a lottery number generator can and cannot do. Because a fair lottery is, by design, completely random, no generator, system or “hot and cold number” strategy can improve your odds of winning — every combination is equally unlikely on every draw. What a generator genuinely offers is convenience and impartiality: it spares you the small but real bias humans show when picking numbers by hand (we over-pick birthdays, avoid consecutive runs and cluster around the centre of the grid), and it lets you produce many distinct lines in seconds. Choosing numbers a generator produced also slightly reduces the chance of sharing a jackpot, since you are less likely to match the popular, human-chosen patterns that many other players use.
If you simply want lucky numbers rather than a formal lottery line, the Numbers tab is perfect: set a range, ask for as many as you like, and treat the result as your numbers for the day. Turn on Seeded mode with today’s date or your name as the seed and you will get the same “lucky” set whenever you use that seed — a fun, repeatable personal ritual. As always, play responsibly: a generator makes choosing numbers easier and fairer, but it cannot change the mathematics of the draw.
Probability and statistics basics
Random numbers are the gateway to understanding probability, and this tool doubles as a hands-on laboratory for it. Probability is simply the proportion of times an outcome would occur over the long run. A fair coin has a probability of 0.5 of landing heads; a fair six-sided die has a probability of 1/6 for each face. You can watch these ideas come alive: flip a coin ten times and you might see seven heads, but flip it ten thousand times in Coin mode and the proportion of heads will hug 50% remarkably closely. That convergence is the Law of Large Numbers — the principle that as the number of trials grows, the observed average closes in on the true probability — and it is the single most important idea in all of statistics.
The statistics panel attached to every generation lets you measure a sample the way a statistician would. The mean is the arithmetic average; the median is the middle value when the numbers are sorted, which resists being dragged around by outliers; and the mode is the most frequently occurring value. The range is the gap between the smallest and largest values, while the standard deviation measures how spread out the numbers are around the mean — a small standard deviation means the values cluster tightly, a large one means they are widely scattered. For a large sample drawn uniformly, you will see the mean settle near the midpoint of your range and the values spread evenly, which the histogram makes visible as a row of roughly equal bars.
This makes the generator a genuinely useful teaching and research instrument. Students can explore sampling, distributions and the difference between theoretical and observed probability without any maths software. Teachers can generate fresh, unpredictable datasets for every class. Researchers can draw simple random samples from a numbered population, assign subjects to treatment and control groups, and use Seeded mode to make their sampling reproducible for peer review. And anyone curious can run the Monte Carlo simulation to estimate quantities like π by scattering random points — a vivid demonstration that, handled correctly, randomness is not chaos but one of the most powerful problem-solving tools we have.