Random number generator
Nothing yet. Results appear here so you can prove what came up.
This generator draws whole numbers from a range you choose, using the browser’s cryptographic randomness with rejection sampling so that every value is equally likely. Turn on "No repeats" to draw distinct numbers — six from forty-nine, for instance — rather than independent draws that may collide. The range runs from negative to positive, up to nine quadrillion wide.
How to use it
Most naive generators take a random 32-bit value and apply a modulus, which quietly favours the low end of any range whose width is not a power of two. This one rejects and redraws the small slice of values that would cause the bias, so a range of 1 to 6 comes out exactly uniform and not merely close to it. The difference is invisible in ten draws and measurable in ten thousand.
A range is also how you draw things that are not really numbers. A random date is a day offset added to a start date, a random page is a page number, and a random row of a spreadsheet is a row number. A window of the day works the same way, as minutes past midnight: 540 to 1020 is 09:00 to 17:00, and dividing the result by 60 gives the hour with the minutes as the remainder. For a time across the whole day the random time generator does that formatting for you and draws all 1,440 minutes; this page is what you want when the window is narrower than the day, or wraps past midnight, since a single range cannot.
What people use it for
- Drawing lottery-style numbers, six distinct from forty-nine
- Running a prize draw someone else can verify from the seed
- Picking a random time inside a window, as minutes past midnight
- Sampling row numbers out of a spreadsheet
- Filling test data with values in a known range
Questions
Yes. From 1 to 100 can produce 1 and can produce 100.
It draws without replacement, so you get distinct values. Asking for more numbers than the range holds returns the whole range, shuffled.
Yes, and this is the page for it. Set the range to the minutes those hours cover: 540 to 1020 is 09:00 to 17:00, and 754 reads as 12:34. Every minute inside the window stays equally likely. The random time generator draws across the whole day and formats the clock for you, but its window is fixed.
Yes, and the seed field is what makes it defensible. Announce the seed beforehand, and anyone can reproduce the draw afterwards.
Set the range to the game — 1 to 49 for a six-from-49 draw — turn on No repeats, and ask for six. Sorting the result makes it easier to check against a ticket.
Yes. Put a negative value in From: −10 to 10 draws from all twenty-one whole numbers in that span.
Not directly; it draws whole numbers. Draw from 0 to 999 and divide by 1000 in your head, or move the range up by three digits.
With the seed left empty it uses crypto.getRandomValues, which the browser seeds from the operating system’s entropy. Entering a seed deliberately switches to a deterministic generator so a draw can be checked.
Anything up to about nine quadrillion. Drawing five distinct numbers from a billion is instant, because the range is never materialised in memory.
Yes. Count the days in the window, draw from 0 to that number, and add the result to your start date. Three hundred and sixty-five values cover a year, one day each.
No. The draw happens in this tab and the history is gone when you leave.