Random Number Generator
Draw whole numbers from a range — or pick at random from a list you paste in.
What this tool does
Random Number Generator draws whole numbers from an inclusive range, so a minimum of 1 and a maximum of 6 can produce both 1 and 6. For any range up to about four billion values wide, each draw takes 32 random bits and throws away any sample that would not divide evenly into the range before taking the remainder, which removes the modulo bias a naive implementation quietly introduces and leaves every value equally likely. A range wider than that — bounds in the trillions — is handled differently: a 53-bit double is scaled across the span instead, which is even enough for shuffling or simulation but is not the same exact construction.
The optional input box changes what is being drawn. Paste items one line at a time — entrant names, teams, tasks — and the Minimum and Maximum boxes stop mattering: positions in your list are drawn instead, and the items themselves are printed. Ask for as many items as the list holds with No repeats switched on, and with Order left on As drawn, and you get the whole list shuffled into a running order, which is a different job from picking a single winner but the same two settings.
Leave Seed empty and the numbers come from crypto.getRandomValues, the browser's link to the operating system's random source, with Math.random standing in only on a browser too old to offer that interface. Which of the two actually ran is recorded internally and never printed: the result panel on a text tool shows the numbers and a one-line summary, and that summary names the count, the range and the seed but not the source. Type anything into Seed and the draw switches to a deterministic generator that returns the identical sequence for that seed every time. Repeatability is the point, and it is also the catch — the seed is the whole secret, so a seeded draw is fine for a fixture and wrong for anything that must be unguessable.
A few hard edges are worth knowing before you start. Whole numbers only: a bound of 1.5 is refused rather than rounded, so this is not the tool for random decimals. One draw returns at most 10,000 values, and asking for more unique numbers than the range contains is rejected with an error naming the size of the range instead of silently repeating. Everything happens in this browser tab and nothing is uploaded, which also means the draw leaves no record — no log, no timestamp, nothing a losing entrant could inspect afterwards.
How to use it
- Set the range. Minimum and Maximum are both included in the draw, so 1 to 6 is a die and 1 to 49 is a lottery ball. Enter them the wrong way round and they are swapped rather than refused.
- Choose how many, and whether repeats are allowed. Up to 10,000 values per draw. With No repeats off the same number can come up twice, which is right for dice throws and wrong for a raffle.
- Or paste a list instead of using the range. One item per line in the input box. Blank lines are skipped, and so is any line beginning with # or // — those are read as comments, so an entrant written as "#1 Fan" is dropped before the draw and never has a chance of winning. The tool draws from the lines that survive, prints the items rather than their positions, and ignores the range settings entirely.
- Set the order, and a seed if you need one. Results appear in the order drawn unless you pick Ascending or Descending. Those sort the numbers — or, when you are drawing from a list, the hidden positions behind the items, so Ascending on a list hands it back in the order you pasted rather than alphabetically, undoing the shuffle you just asked for. A seed makes the same draw reproducible; leave it blank for a fresh one each time.
Processing & privacy
Runs on your device. Your file is processed directly in this browser.
Common use cases
Rolling dice you do not have
Minimum 1, maximum 6, and as many rolls as the turn needs in one go, so 3d6 is one draw of three numbers rather than three visits to the page. The rolls are printed as they fall and the adding up is left to you.
Picking a winner from a list of entrants
Paste the names and ask for one. The output is a person's name, not a row number you then have to count down a spreadsheet to find.
Choosing lottery numbers
Six from 1 to 49 with No repeats on and ascending order, which is the order the numbers are printed on the slip.
Building reproducible test data
A fixed seed returns the same values on every run, so a test or a demo that depends on those numbers does not drift between executions.
Deciding who goes first
Paste the group, request as many picks as there are names with No repeats on, and leave Order on As drawn — the result is the whole list in a random running order.
Questions
Are the numbers sent anywhere?
How random are the numbers really?
What does the seed do?
Can I generate decimals?
Why was my request for unique numbers refused?
I drew from a list and the same name appeared twice
Can I use this to run an official prize draw?
How many numbers can one draw return?
Related tools
- Percentage Calculator — Work out percentages, increases and decreases.
- Date Difference — Count days, weeks or months between two dates.
- Loan Calculator — Estimate repayments, interest and total cost.
- Compound Interest — Project growth with regular contributions.
- VAT & Sales Tax — Add or remove tax from a price.
- Tip Calculator — Split a bill and calculate the tip per person.