Free, no sign-up
Random number generator
Pick one or many random numbers between any two values: a raffle winner, a dice roll, a sample of rows from a list or a set of test data. Numbers come from the cryptographic generator built into your browser, every value in the range has exactly the same chance, and nothing is sent to a server.
Press Generate to draw the numbers.
How to use it
- Set the range. Type the smallest and largest number that can come out. Both ends are included, so 1 to 6 works like a die.
- Choose how many and how. Enter how many numbers you need, turn "No repeats" on or off and pick the order: as drawn, ascending or descending. For decimals, switch the type and choose the number of places.
- Press Generate. The numbers appear at once with the lowest, highest and average value. Copy them or download a .txt file with one number per line. Press again for a new draw.
How the numbers are generated
The generator uses crypto.getRandomValues, the Web Crypto API that browsers provide for security tasks such as creating keys. It draws on the operating system's entropy source, so the numbers cannot be predicted from earlier ones, unlike the simpler Math.random used by many websites.
Turning random bits into a number in your range needs care. The obvious method, taking the remainder of a division, slightly favors some numbers whenever the range does not divide the generator's range exactly. This tool uses rejection sampling instead: it discards the few raw values that would cause the bias and draws again, so every number in the range has exactly the same probability.
Draws without repeats use a partial Fisher-Yates shuffle, the algorithm described by Donald Knuth: it picks the first number from the whole range, the second from the numbers left, and so on, like taking balls out of a bag. It only remembers the positions it has moved, so even a range of a billion numbers takes no extra memory. Decimal mode works the same way on a grid: 0 to 1 with two places means the 101 values 0.00, 0.01 … 1.00, each equally likely.
Worked examples
The examples below were produced by the same algorithm as the tool, with a fixed seed so that the page always shows the same numbers. The real tool never uses a seed.
Three raffle winners out of 250 tickets
Range 1 to 250, count 3, no repeats. Result: 176, 68, 25. The first number is first prize, and no ticket can win twice.
Ten dice rolls
Range 1 to 6, count 10, repeats allowed. Result: 2, 1, 1, 1, 6, 1, 5, 2, 3, 3. Repeats are expected: with ten rolls of a six-sided die, at least one number must come up more than once.
Checking that it is fair
We drew 10,000 numbers from 1 to 10. Each value should appear about 1,000 times; the counts were 1,010, 1,025, 970, 957, 986, 997, 1,056, 1,080, 956, 963. The chi-square statistic is 16.52, below 27.88, the critical value for 9 degrees of freedom at the 0.1% level, so there is no sign of bias.
Good uses and one clear limit
- Raffles, giveaways and choosing who goes first, with the result copied as proof.
- Picking random rows to audit: number the rows and draw without repeats.
- Test data and classroom exercises on probability.
- Board games when the dice are missing.
Do not use this tool for gambling with money or for any draw regulated by law, such as lotteries or prize competitions that require a certified random generator, a notary or an official procedure. It is free, private and fair, but it is not certified and it keeps no audit log.
For a draw that other people must trust, announce the rules before you press Generate: the range, the count and what the first number means. Then share the copied result or the downloaded file right away. If you need to convert a list of results into another format, the Base64 encoder and decoder can help, and the percentage calculator gives you the odds, for example 3 winners out of 250 is 1.2%.
Sources
- W3C, Web Cryptography API, method getRandomValues: cryptographically strong random values.
- Donald E. Knuth, The Art of Computer Programming, vol. 2, Seminumerical Algorithms, section 3.4.2, Algorithm P (random permutation, known as the Fisher-Yates shuffle).
- Chi-square distribution tables: critical value 27.88 for 9 degrees of freedom at p = 0.001.
Sources checked on October 14, 2026.
Frequently asked questions
Are these numbers truly random?
Can the same number come out twice?
How do I pick a random number between 1 and 100?
Can I generate negative or decimal numbers?
Is my draw stored anywhere?
Can I use it for a lottery or a betting game?
What is the maximum?
Last updated Wednesday, October 14, 2026