Draw random numbers, fairly
Pick numbers in any range free, with or without repeats, drawn from your browser's cryptographic random source. No server, no seed, no hidden bias.
How it works
Numbers come from crypto.getRandomValues as 32-bit draws. Each draw that lands above the largest whole multiple of the range is discarded and taken again, which is what removes the small bias that plain remainder arithmetic introduces. With repeats switched off, small selections are drawn and filtered while large ones — more than half the range — are produced by shuffling the whole range instead, so the work stays bounded either way.
What to watch out for
Asking for 1 to 6 can return 1 and can return 6, which is what people mean by a dice roll. Some tools exclude the top of the range and some include it, so a generator that quietly did the opposite would produce results that look right and are subtly wrong across many draws.
Ten draws from 1 to 10 will usually contain a duplicate and will usually miss a number entirely. That is what randomness looks like and not a fault. Switch off repeats when you are drawing a raffle or picking a sample, where each result must be distinct.
The source is the operating system's, which takes no seed and cannot be replayed. That is right for a draw that should not be predictable and wrong for a simulation you need to run again identically. For reproducible work you want a seeded generator, which this deliberately is not.
Nothing here can prove to a third party that a draw was honest. For a prize draw where the result may be disputed, what matters is a procedure witnesses accept — drawing in front of people, or a service that publishes a commitment beforehand. This tool gives you a fair number, not evidence that you used it.
Limits
Files up to about 1 MB work reliably. Beyond that, the ceiling is your device's memory rather than any rule we impose — the work happens on your own machine. Tested in Chrome 140, Firefox 143, Safari 18.
The bias almost every generator has
There is a line that appears in nearly every random-number tutorial:
value = random() % (max - min + 1) + min
It is wrong, in a way that never shows up in testing.
A random byte gives 256 equally likely values. Ask for a number from 1 to 6 and 256 does not divide by 6: it goes 42 times with 4 left over. Those four leftover values map back onto the first four outcomes, so 1, 2, 3 and 4 come up very slightly more often than 5 and 6 — about 0.4% more, forever.
Nobody notices in a hundred draws. It is real over a million.
The fix is to throw away the leftovers: when a draw lands in the uneven tail, draw again. That is what happens here, on every number.
Which random source
Browsers offer two. Math.random is fast, pseudo-random and seeded from a small
amount of internal state — fine for shuffling a playlist, unsuitable for anything
where somebody might benefit from predicting the result.
crypto.getRandomValues is the operating system’s cryptographic source. It is
slower in a way you will never notice at a thousand numbers, and it cannot be
predicted from previous output. That is what this uses, because most of the
reasons people reach for a random number generator involve somebody caring about
the answer.
No repeats, and what it costs
With repeats allowed, each number is an independent draw and any number can come up any number of times.
With repeats switched off, the results are distinct. Two different methods do this, chosen by how much of the range you are asking for. For a small selection out of a large range — ten numbers from a million — drawing and discarding duplicates is almost free. For a large selection — ninety numbers out of a hundred — that turns into waiting for the last few stragglers to appear, so the whole range is shuffled and the first ninety taken instead.
Same result, bounded work either way.
If the draw has to be trusted by others
This is worth saying plainly, because it is the one thing a tool like this cannot give you.
A number drawn here is fair. It is not provably fair to somebody who was not watching, because nothing about the result shows how it was produced. If you are running a prize draw where a loser might object, that gap matters.
What works instead: draw in front of witnesses or on a recording, or use a service that publishes a commitment before the draw and the value afterwards. Those produce evidence. This produces a number.
Nothing is uploaded
The draw happens in your browser. No request is made, so there is no log of what you drew, when, or how many times you tried again — which is worth knowing if the numbers are going into something anyone might later ask questions about.
Your files never leave your browser. Last updated 2026-08-02.
Related tools
- Generate passwords that never leave this pageStrong random passwords generated free by your own browser from the operating system's cryptographic source. Nothing is transmitted, logged or stored.
- Count words, characters and reading timePaste text and see words, characters, sentences, paragraphs and reading time update as you type. Free, no account, and nothing is uploaded or stored.
- Make a QR code that stays yoursType a link, a message or a Wi-Fi password and get a free QR code as PNG or SVG. No account, no expiry, no tracking redirect, and nothing is uploaded.