Generate random numbers instantly with customisable ranges, unique selections, decimal support, exclusions and easy-to-use tools for education, programming, games and statistics.
To pick a random whole number between a minimum and a maximum, use min + floor(r × (max − min + 1)), where r is a uniform random value in [0, 1). The + 1 matters — leave it out and the maximum can never be selected. For a random decimal, use min + r × (max − min) instead. This page draws its randomness from your browser's crypto.getRandomValues() where available, with rejection sampling so every value in the range is exactly equally likely, rather than the very slight bias plain scaling introduces.
Quick presets
Keyboard: Space generate S generate set C copy Ctrl+C copy (when no text is selected). Shortcuts pause while you are typing in a field.
Tap or press Enter on the number to draw again
Set Result
Generate a random quick pick for the main Australian draw games. Numbers are drawn without replacement, exactly as the official draws do. Always buy tickets through the official provider.
For entertainment only — not an official ticket, and no combination is more likely than any other. Gamble responsibly; support is available on 1800 858 858.
Paste a list of names — one per line, or separated by commas — then draw winners at random. Ideal for classrooms, giveaways, team selection and competitions.
Run many draws over the range set in the Single Random Number card above and see how evenly the results fall. With a fair generator the bars level out as the number of draws grows.
Looking for a random password rather than a number? This uses the browser's cryptographic generator directly and never the seeded mode, so every password is unpredictable. Nothing is sent anywhere — it is generated in your browser.
Test an existing password's strength with the Password Strength Checker. Never share a password by email or message.
A random number generator is a tool that produces numbers with no predictable pattern, so that every possible outcome within a defined range has an equal chance of appearing. Ask for a number between 1 and 100 and each of those hundred values should turn up about one time in a hundred over the long run, with no way to guess which one is coming next.
That sounds simple, and using one is simple, but the underlying problem is genuinely hard. Computers are built to be deterministic — the same instructions with the same inputs must give the same outputs, every time. Randomness is the opposite of that. So generating random numbers on a machine designed never to be unpredictable requires either a clever algorithm that behaves as if it were unpredictable, or a source of genuine physical unpredictability fed in from outside.
Both approaches exist, and the difference between them matters enormously in security and almost not at all in a classroom raffle. The sections below explain when to care.
Almost every random number you encounter starts as a uniform value between 0 and 1 — a raw fraction with no bias towards any part of that interval. Everything else is built by transforming it. To land in a range, multiply and shift; to pick from a list, scale up to the list length and take the integer part.
The + 1 in the integer version is the single most commonly dropped detail in the entire topic. Since r never quite reaches 1, multiplying by (max − min) and flooring can never produce the maximum, so that value would be silently impossible. Adding 1 to the multiplier fixes it and gives every value an equal share.
An algorithmic generator keeps an internal state, and each request applies a mathematical transformation to that state to produce the next output. Given the same starting state, called the seed, the whole sequence repeats identically. A cryptographic generator instead gathers entropy from unpredictable physical sources the operating system observes — the precise timing of keystrokes and disk operations, thermal noise in the hardware, interrupt jitter — and mixes it in so the internal state cannot be reconstructed from the outputs.
This page uses the browser's crypto.getRandomValues(), which draws on the operating system's entropy pool, with a rejection-sampling step described below.
| Feature | PRNG (pseudo random) | CSPRNG (cryptographically secure) | TRNG (true random) |
|---|---|---|---|
| Source | Mathematical formula plus a seed | Operating system entropy pool | Physical process |
| Deterministic? | Yes — the same seed repeats the sequence | No, for practical purposes | No |
| Predictable? | Yes, if the state is known | Not feasibly | No |
| Speed | Very fast | Fast | Slow — limited by the physical source |
| Reproducible for research? | Yes, which is often the point | No | No |
| Typical examples | Math.random(), Mersenne Twister | crypto.getRandomValues(), /dev/urandom | Atmospheric noise, radioactive decay, quantum devices |
| Right for | Games, simulations, shuffling, classroom use | Passwords, keys, tokens, anything security-related | Certified draws, cryptographic seeding, physics research |
A pseudo random generator is not a lesser tool — it is the correct tool for most jobs, and its reproducibility is a feature. A researcher who seeds a simulation with 42 can rerun the identical experiment years later and get the identical result, which is essential for verifying published work. What a PRNG must never be used for is anything an adversary would benefit from predicting.
Several families of algorithm turn up repeatedly in software.
Suppose you have a raw random 32-bit integer and want a number from 1 to 6. Simply taking the remainder introduces bias, because 2³² is not divisible by 6 — a few values end up very slightly more likely than the rest. The fix is to discard raw values that fall in the uneven tail and draw again, which is called rejection sampling. The bias is minuscule for small ranges and irrelevant to a raffle, but it is real, it grows with the range size, and it is easy to eliminate. This generator eliminates it.
A seed is the starting value of a pseudo random generator's internal state. Give the generator the same seed and it walks the identical path through its sequence, producing the same numbers in the same order every time. That sounds like the opposite of randomness, and in a sense it is — but it is exactly what several jobs require.
The seed field in the calculator above switches on a small deterministic generator (a mulberry32 variant seeded by hashing your text). Clear the field and it returns to the browser's cryptographic source. One warning worth repeating: seeded output is reproducible by definition, so it must never be used for a password, key or token.
You cannot judge a random generator from a handful of draws — clustering is normal and streaks prove nothing. What you can do is run a great many draws and check whether each outcome appears about as often as expected. The fairness chart on this page does exactly that, and it demonstrates the underlying principle nicely: over 100 draws of a six-sided die the counts are visibly lopsided, by 1,000 they are closer, and by 10,000 they are usually within a couple of per cent of the expected value.
Statisticians formalise this with the chi-square goodness-of-fit test, which adds up the squared differences between observed and expected counts relative to what is expected. Small values indicate the observations are consistent with a uniform distribution; very large values suggest bias. The chart reports the statistic and the degrees of freedom so you can compare it with a standard table. Professional test suites such as NIST SP 800-22 apply dozens of far more demanding tests than a simple frequency count.
| Aspect | Random integers | Random decimals |
|---|---|---|
| Possible outcomes | Finite: max − min + 1 | Effectively unlimited, limited only by rounding |
| Endpoints | Both min and max are reachable | min is reachable; max effectively is not |
| Probability of one value | 1 ÷ (max − min + 1) | Essentially zero for an exact value |
| Duplicates | Common in small ranges | Rare unless decimal places are few |
| Best for | Dice, lotteries, picking people, list indexes | Simulations, measurements, probabilities, coordinates |
In a range of 1 to 6 a repeat is almost guaranteed within a handful of draws, while random decimals to four places between 0 and 1 have ten thousand possibilities and rarely collide. That is why the unique-numbers option is essential for integers and mostly cosmetic for decimals.
Choosing between them is really choosing between two different physical models.
Unique (drawing without replacement) is a raffle barrel: once a ticket is out, it cannot come out again. Each draw shrinks the pool, so the probabilities shift slightly as you go. This is what lotteries do, and what you want for picking six different students, allocating unique IDs, or generating a lottery line.
Repeating (drawing with replacement) is a die: every roll is independent, and the previous result has no effect at all. Use it for simulations, dice, and any sampling where you genuinely want each draw to be a fresh independent trial.
A random number generator is one of the quietest fairness tools a teacher has. Number the roll and draw a student to answer, and nobody can argue about favouritism or predict when their turn is coming. Number the class and generate unique sets to form groups without the social damage of picking teams by hand. Beyond that it produces endless fresh practice questions, decides who presents first, allocates topics, and runs simple probability experiments where students can compare theoretical expectations with what actually happened over fifty trials.
The unique-numbers option matters here: for cold-calling across a lesson you want draws without replacement so the same student is not asked three times while another is never asked at all. Use the exclusion field to skip absent students.
Every possible combination in a lottery draw has exactly the same probability, so a randomly generated line is neither better nor worse than birthdays, patterns, or last week's winning numbers. What random selection does help with is avoiding popular combinations: if you happen to win with 1-2-3-4-5-6 or a neat diagonal on the coupon, you will be splitting the prize with a great many other people who chose the same thing. Random lines tend to be unpopular lines.
| Game | Format | Possible combinations | Division 1 odds per line |
|---|---|---|---|
| Saturday Lotto | 6 from 45 | C(45, 6) = 8,145,060 | 1 in 8,145,060 |
| Oz Lotto | 7 from 47 | C(47, 7) = 62,891,499 | 1 in 62,891,499 |
| Powerball | 7 from 35 + 1 from 20 | C(35, 7) × 20 = 134,490,400 | 1 in 134,490,400 |
| Set for Life | 8 from 37 | C(37, 8) = 38,608,020 | 1 in 38,608,020 |
No generator, pattern or system changes those numbers. Anything advertised as improving your odds of a jackpot is either selling you more entries or selling you nothing.
Random selection is what allows a small sample to say something trustworthy about a large population. If every member has an equal chance of being chosen, the sample has no systematic tilt, and standard statistical methods can quantify how far the sample result might sit from the truth. Choose by convenience instead — the first fifty who reply, the customers who happen to be in store — and that guarantee disappears, no matter how many you collect.
The usual method is to number the population, then generate unique random numbers to select the sample. Related designs build on the same tool: systematic sampling picks a random start then takes every kth member, stratified sampling divides the population into groups and samples randomly within each, and bootstrapping resamples the existing data with replacement thousands of times to estimate uncertainty. Once you have your sample, the standard deviation calculator will summarise its spread.
Random numbers appear throughout everyday software: shuffling a playlist, assigning session identifiers, splitting users into A/B test groups, generating test fixtures, jittering retry delays so that thousands of clients do not all reconnect at the same instant, and load-testing with unpredictable input.
Two practical warnings are worth carrying into any language. First, use the cryptographic generator for anything a user should not be able to guess — session tokens, password reset links, API keys — never the general-purpose one. Second, if you shuffle a list, use the Fisher-Yates algorithm: walk backwards through the array swapping each element with a randomly chosen earlier one. The tempting one-liner of sorting with a random comparator produces a measurably uneven distribution and, in some engines, undefined behaviour.
Cryptography depends on randomness more completely than any other field. Encryption keys, initialisation vectors, salts, nonces and tokens all need values an attacker cannot reproduce, because the entire security of a system usually rests on the secret being unguessable rather than on the algorithm being unknown.
History is full of failures at exactly this point. Predictable seeding — using the current time, a process ID, or a fixed value — has repeatedly reduced key spaces from astronomically large to trivially searchable, while the algorithms themselves remained perfectly sound. This is why cryptographic generators are continually reseeded from hardware entropy and why security guidance is unanimous: never use a general-purpose random function for security, and never invent your own.
Monte Carlo methods answer questions that are hard to solve algebraically by running enormous numbers of random trials and looking at the distribution of results. The technique was developed during 1940s nuclear research, named after the casino, and it now underpins financial risk modelling, engineering reliability analysis, weather ensembles, epidemiology and computer graphics.
That square-root relationship is the defining characteristic of Monte Carlo work. It is why simulations run millions of trials rather than thousands, and why generator speed and statistical quality both matter at scale in a way they never do for a single raffle draw.
Games run on randomness: dice rolls, card shuffles, loot drops, critical hits, enemy placement and procedurally generated worlds. Seeded generation is especially powerful here — a single seed value can reproduce an entire world, which is how players share map codes and how developers reproduce a bug that only appears in one particular layout.
Two design points are worth knowing. Many games deliberately use non-uniform randomness because true uniformity feels unfair to players: streaks of bad luck occur naturally and get perceived as broken, so systems often nudge probabilities after repeated failures. And any game where money changes hands is regulated, requiring certified generators and independent auditing precisely because the fairness of the random source is the fairness of the game.
| Mistake | Why it goes wrong | How to avoid it |
|---|---|---|
| Forgetting the + 1 for integers | The maximum can never be selected | Use floor(r × (max − min + 1)) + min |
| Using a general-purpose generator for security | Outputs are predictable from the internal state | Use the platform's cryptographic generator |
| Requesting more unique values than the range holds | Impossible — the pool runs out | Widen the range, lower the count, or allow duplicates |
| Shuffling with a random sort comparator | Produces an uneven, biased distribution | Use the Fisher-Yates shuffle |
| Expecting randomness to look even | Genuine randomness contains clusters and streaks | Judge over thousands of draws, not a handful |
| Believing past draws affect future ones | Independent draws have no memory — the gambler's fallacy | A number appearing last week changes nothing |
| Seeding with the current time in security code | Time is guessable, so the whole sequence is guessable | Seed from OS entropy, or use a CSPRNG directly |
| Assuming "random" means fair without checking the range | An off-by-one or wrong bound skews everything | Test the endpoints appear, and appear equally often |
| Reusing one draw where independent draws are needed | Correlated values invalidate simulations and samples | Draw fresh values for each trial |
min + floor(r × (max − min + 1))min + r × (max − min)max − min + 11 / (max − min + 1)1 − (1 − 1/k)^nk!/((k−n)! × kⁿ)C(n, r) = n! / (r!(n − r)!)randInt(0, 1) | Die: randInt(1, 6)crypto.getRandomValues(), /dev/urandomFisher-Yates, never a random sort comparatorerror ∝ 1 / √trials
1) 20 − 5 + 1 = 16 2) 1/50 = 2% 3) 1 + floor(75) = 76 4) No — only 6 values exist, so at most 6 unique draws are possible 5) Still 1/6. Rolls are independent; expecting otherwise is the gambler's fallacy
1) The pool is 28 values, so 1/28 ≈ 3.571% 2) 1 − (99/100)¹⁰ ≈ 9.56% 3) C(45, 6) = 8,145,060 4) 1 − (45×44×43×42×41×40)/45⁶ ≈ 29.4% 5) Error falls with 1/√n, so doubling precision needs 4 times the trials — 40,000
What is a random number generator?
A random number generator is a tool that produces numbers with no predictable pattern, giving every possible value in a chosen range an equal chance of appearing. It can be an algorithm running on a computer, a physical device measuring an unpredictable process, or something as simple as a die. On this page you set a minimum and maximum, choose whole numbers or decimals, and the generator draws values that are uniformly distributed across that range.
How does a random number generator work?
Most generators first produce a uniform value between 0 and 1, then transform it into the range you asked for. For whole numbers the formula is min + floor(r × (max − min + 1)); for decimals it is min + r × (max − min). The raw value comes either from a mathematical formula applied to an internal state, or from entropy the operating system has collected from unpredictable physical events such as hardware timing and thermal noise.
Is a random number generator truly random?
Not usually, in the strict sense. Most software generators are pseudo random: they follow a deterministic formula, so the same starting seed always produces the same sequence. Cryptographically secure generators use operating system entropy and cannot feasibly be predicted, which is close enough to true randomness for any practical purpose. Genuinely true randomness requires a physical source such as atmospheric noise, radioactive decay or a quantum device. This page uses your browser's cryptographic generator where available.
What is the difference between PRNG and TRNG?
A PRNG (pseudo random number generator) uses a mathematical algorithm and a seed, so it is fast, reproducible and deterministic — the same seed gives the same sequence every time. A TRNG (true random number generator) measures an unpredictable physical process, so it cannot be reproduced or predicted, but it is slower and needs dedicated hardware. Between them sits the CSPRNG, an algorithmic generator continually reseeded from hardware entropy, which is what security-sensitive software actually uses.
Can random numbers repeat?
Yes, and far more often than people expect. If each draw is independent, nothing prevents the same value coming up twice — drawing 6 numbers from 1 to 45 with duplicates allowed gives roughly a 29% chance of at least one repeat. If you need every result to be different, use the unique option, which removes each value from the pool once drawn, exactly as a raffle barrel does.
How do you generate random numbers between two values?
For a whole number, calculate min + floor(r × (max − min + 1)) where r is a uniform random value in [0, 1). For 1 to 100 that becomes 1 + floor(r × 100). The + 1 is essential: without it the maximum can never be selected, because r never quite reaches 1. For a decimal, use min + r × (max − min) and round to the number of places you need.
What is a random integer?
A random integer is a randomly selected whole number with no fractional part — 7, 42, −3. In an inclusive range there are exactly max − min + 1 possible integers, and each should have probability 1 ÷ (max − min + 1). Random integers suit dice, lotteries, picking people from a numbered list, and choosing an item by index in programming.
How do you generate unique random numbers?
Build a pool of all candidate values, draw one at random, remove it from the pool, and repeat. This is sampling without replacement and it guarantees no duplicates. The important limit is that you cannot draw more unique values than the range contains — 10 unique numbers cannot come from 1 to 5. This generator checks that before drawing and explains the problem instead of quietly returning fewer numbers than you asked for.
What is a secure random number generator?
A cryptographically secure generator produces values that cannot feasibly be predicted even by someone who has seen many previous outputs. It draws entropy from unpredictable hardware events and is continually reseeded, so the internal state cannot be reconstructed. In browsers it is crypto.getRandomValues(); on Linux it is /dev/urandom. Use one for encryption keys, session tokens, password reset links and anything else an attacker would benefit from guessing.
Can random number generators be predicted?
Pseudo random generators can be. Given enough consecutive outputs, the internal state of a generator like the Mersenne Twister can be reconstructed and every future value calculated exactly. Cryptographically secure generators are designed specifically to prevent this and cannot be predicted in practice. Most real-world security failures involving randomness came not from breaking the algorithm but from predictable seeding, such as using the current time.
What is the best random number generator?
It depends entirely on the job. For security, use the platform's cryptographic generator. For scientific simulation, use a well-tested statistical generator such as the Mersenne Twister or a modern PCG variant, and record the seed so the work can be reproduced. For games, shuffling and classroom use, any reasonable built-in generator is fine. There is no single best choice, only a best fit for the requirement.
How are random numbers used in statistics?
Random selection is what allows a sample to represent a population. If every member has an equal chance of selection, the sample carries no systematic bias and standard methods can quantify the uncertainty in the result. Random numbers also drive stratified and systematic sampling, random assignment of participants to treatment groups in experiments, and resampling techniques such as bootstrapping, which draw thousands of samples with replacement to estimate how variable an estimate is.
How are random numbers used in programming?
They shuffle playlists, generate session and transaction identifiers, split users into A/B test groups, create test data, add jitter to retry delays so clients do not all reconnect simultaneously, and power procedural content generation. Two rules matter: use the cryptographic generator for anything that must be unguessable, and shuffle with the Fisher-Yates algorithm rather than sorting by a random comparator, which produces a biased distribution.
Can I generate lottery numbers randomly?
Yes, and the quick pick tool on this page does exactly that for the main Australian games, drawing without replacement just as the official draws do. Bear in mind that every combination has identical probability, so a random line is no more likely to win than any other. Its only genuine advantage is avoiding popular patterns like 1-2-3-4-5-6, which would mean sharing a prize with many other players. Numbers generated here are for entertainment and become an entry only if you buy the line through an official provider.
How do I pick a random winner?
Number your entrants from 1 upward, set the minimum to 1 and the maximum to the total number of entries, then generate. For multiple winners, use the set generator with unique numbers so nobody can win twice, and use the exclusion field to skip withdrawn entrants. Announcing the method before drawing — and drawing in front of the group — is what makes the result defensible, since the process is visibly independent of who anyone wanted to win.
What is Monte Carlo simulation?
A Monte Carlo simulation solves a problem by running a very large number of random trials and examining the distribution of results, rather than solving it algebraically. It is used in financial risk modelling, engineering reliability, weather forecasting ensembles and computer graphics. Its precision improves with the square root of the number of trials, so quadrupling the trials only doubles the accuracy — which is why these simulations run millions of iterations.
Why do random results sometimes look clustered?
Because genuine randomness is clumpy. Truly independent draws produce streaks, repeats and gaps, and a sequence that looked perfectly evenly spread would actually be evidence of something non-random. People consistently underestimate how much clustering to expect, which is why a fair generator often feels broken over a handful of draws. Uniformity only becomes visible over thousands of results.
What is a seed, and why would I use one?
A seed is the starting state of a pseudo random generator. Enter the same seed and you get the same sequence of numbers every time, which is essential for reproducing a software bug, rerunning a simulation exactly as published, or giving a whole class the identical set of practice numbers. Leave the seed field blank and this page uses your browser's cryptographic generator instead. Never use seeded output for a password, key or token, because anyone with the seed can reproduce it.
Can I pick a random name instead of a number?
Yes. The random name picker on this page takes a pasted list — one name per line, or separated by commas — and draws winners at random. By default a name cannot be drawn twice, which suits raffles, giveaways, cold-calling in class and team selection, and you can allow repeats if you want each draw to be independent. It also reports each entrant's probability and how many names were in the pool, so the draw is defensible if anyone questions it.
Does this random number generator show its working?
Yes. Every draw lists the range size, the formula applied, the probability of each candidate, and how exclusions changed the pool. The set generator adds the count, sum, mean, median, lowest, highest and how many distinct values were returned, plus an explanation of whether unique or repeating mode was used. You can set decimal places, exclude specific numbers, sort ascending or descending, keep a history of the last 20 single draws, and copy any result to the clipboard.