Is an Online Random Number Generator Truly Random? How It Works
How browser random number generators pick numbers, how Math.random differs from crypto.getRandomValues, and when an online picker is fair enough to use.
The short answer
No computer program produces "true" randomness in the sense of a coin toss governed by physics. What a good online generator does is use a cryptographically strong pseudo-random number generator: an algorithm seeded with unpredictable data collected by your operating system. The Random Number Generator on Lazyblink uses the browser's crypto.getRandomValues for this. Its results cannot be predicted in practice, which makes it fair for raffles, classroom picks, games and test data.
True random vs pseudo-random
| Type | How it works | Example |
|---|---|---|
| True random | Measures an unpredictable physical process | Electronic noise, radioactive decay, dice |
| Pseudo-random (basic) | A formula produces a sequence that looks random from a starting seed | JavaScript Math.random, spreadsheet RAND |
| Pseudo-random (cryptographic) | A stronger algorithm seeded with entropy gathered by the operating system, designed so outputs cannot be predicted | crypto.getRandomValues, operating system random devices |
MDN's documentation explains that browsers implementing getRandomValues do not use a truly random generator for performance reasons, but a pseudo-random algorithm "seeded with a value with enough entropy", and that it is "suitable for cryptographic purposes". MDN describes Math.random as "a non-cryptographic source of random numbers".
For a lucky draw, the important property is not where the randomness comes from but whether anyone could predict or influence the result. A cryptographic generator is designed so they cannot.
How the Lazyblink generator picks a number
crypto.getRandomValues.min + (value mod range), where range is max − min + 1.Is every number equally likely?
Almost exactly. Mapping a 32-bit number into a range with "mod" gives a tiny advantage to some values when the range does not divide 2^32 evenly. For 1 to 100, 96 of the numbers have one extra chance in about 42.9 million. In relative terms that is a difference of roughly 0.0000023%, which no raffle or game could ever detect. Security code that needs perfectly uniform output uses a technique called rejection sampling, but for picking winners this effect is negligible.
Using the tool
Quick presets set the range for a dice roll (1–6), 1–100, 1–1000 and a coin flip (0–1, so you decide in advance which of 0 and 1 means heads).
If you tick No duplicate numbers and ask for more numbers than the range contains, for example 10 unique numbers between 1 and 6, you will get fewer than you asked for, because only six distinct values exist. Check the count before you announce results.
Why random results often look "not random"
People expect randomness to look evenly spread. Real random sequences are lumpier than that:
- Repeats happen. Rolling 1–6 ten times without repeats would be unusual. Getting the same number twice in a row is normal.
- Streaks happen. Five tosses of heads in a row has a 1 in 32 chance, so it will turn up regularly over many sessions.
- Clusters happen. In a draw of 10 numbers from 1 to 100, it is common to see several numbers close together.
If a result looks suspicious, that alone is not evidence of a broken generator. What matters is the method, and that nobody could choose the outcome.
Making a draw fair and transparent
For an office raffle, a giveaway or a classroom pick, the generator is the easy part. Fairness also depends on the process:
Our guide to raffle draws without repeats walks through a full example.
For official lotteries, regulated prize competitions or anything with legal requirements, follow the rules that apply to you. These often require certified equipment or an independent witness, which a browser tool cannot provide.
When not to use a random number tool
- Passwords. A random number is not a password. Use the Password Generator, which builds a password from a character set.
- Encryption keys. Use the key-generation functions of a proper cryptographic library. MDN itself recommends
generateKey()rather than raw random values for keys. - Shuffling a long list. You can draw unique numbers and use them as positions, but a dedicated shuffle is simpler for large lists.
Privacy
The numbers are generated in your browser. Nothing you enter is sent to a server, and the results are not stored after you close the page, so copy or screenshot them if you need a record.
Summary
- Online generators are pseudo-random, not physically random.
- A cryptographic source such as crypto.getRandomValues is unpredictable in practice.
- Lazyblink uses crypto.getRandomValues; the tiny bias from range mapping is far too small to matter for draws.
- Repeats and streaks are a normal part of randomness.
- A fair draw also needs a published list, fixed rules and a recorded result.
Frequently asked questions
Is an online random number generator truly random?
Not in the physics sense. Browser generators use a pseudo-random number generator seeded with unpredictable data from the operating system. When it is a cryptographically strong generator such as crypto.getRandomValues, the output is unpredictable enough for security uses, which is far more than a raffle or game needs.
What does the Lazyblink random number generator use?
It uses the browser's crypto.getRandomValues function, which MDN describes as providing cryptographically strong random values, and maps each value into your chosen range.
Can the same number come up twice?
Yes, unless you tick No duplicate numbers. Repeats are normal in genuine random draws. With the option ticked, each number appears at most once in a batch.
Is Math.random good enough for a lucky draw?
For a casual game it is usually fine, but MDN describes Math.random as a non-cryptographic source. For anything where people might dispute fairness or money is involved, use a tool based on crypto.getRandomValues and record how the draw was done.
Put this guide into practice with our free online tool — no signup required.
Open tool