What this tool does
This random number generator draws whole numbers or decimals between any two values you choose, one at a time or up to a thousand at once, with or without repeats. Both ends are inclusive: ask for 1 to 6 and you can get 1 or 6, which is not true of every generator you will find.
The numbers come from crypto.getRandomValues in your own browser. Nothing is requested from a
server, nothing is logged, and the draw cannot be replayed — including by us.
Pseudorandom, cryptographic, and the difference that matters
Math.random is a pseudorandom generator: a small amount of internal state, a fast arithmetic step,
and a stream of numbers that pass the usual statistical tests. It is perfect for jitter, for shuffling
a demo playlist, for a particle effect. It is also completely predictable to anyone who recovers that
state, and browsers make no promise about how it is seeded.
crypto.getRandomValues is the other kind. It draws from the operating system's entropy pool through
a construction meant to survive an adversary who has seen a great deal of previous output. The cost
is negligible at this scale, and the difference only shows up when someone has a reason to guess your
next number — a prize, a slot in a queue, a token. Since that is exactly the case where a random
number tool gets used, this page uses the strong one for everything.
Why the remainder gets thrown away
The naive way to get a number from 1 to 6 out of a 32-bit draw is to take the remainder after dividing by 6. It looks fair and it is not. 4,294,967,296 divided by 6 leaves 4 over, so four of the six outcomes appear one extra time in the mapping and come up slightly more often.
The fix costs four lines: work out where the last complete cycle ends, discard any draw beyond it, and go again. In a range of 6 the discarded slice is four values out of four billion, so in practice you almost never draw twice — but the result is exactly uniform rather than nearly uniform, and "nearly" is not a property you want to explain afterwards.
Decimals go through the same path. Asking for two decimal places between 0 and 1 is treated as a draw among the 101 whole numbers from 0 to 100, which is then divided. No floating point addition happens anywhere near the draw, so 0.30 is exactly as likely as 0.29.
Repeats, and the birthday problem
With repeats allowed, every number is an independent draw and duplicates are normal — expected, even. Pull ten numbers from 1 to 100 and the chance that at least two match is about 37%, which surprises people every time. It is the same arithmetic that makes two people in a room of 23 share a birthday more often than not.
Switching repeats off changes the experiment. The draw becomes a sample without replacement, implemented as a partial Fisher–Yates shuffle over the range: each pick swaps a used slot out of the pool, so nothing can come back. Only the positions actually touched are stored, which is why you can ask for ten distinct numbers between 1 and a billion without the page allocating a billion of anything.
No seed, on purpose
There is no seed field here. A seeded generator is reproducible by design, and reproducibility is the opposite of what a draw with something at stake needs — whoever knows the seed can replay the winner. Seeds belong in your test suite, where a fixed sequence is the point, not on a page whose whole job is to be unguessable.
Need something other than numbers? The password generator uses the same rejection sampling over character sets, and the UUID generator covers identifiers.