Random Number Generator
Generate one number or ten thousand, as whole numbers or decimals, with repeats, exclusions, sorting and CSV export.
Selections are generated locally in your browser using the Web Crypto API when available. The result is chosen before the animation starts, so how the animation looks can never change what is picked.
Loading the random number generator…
What is the Random Number Generator?
This is the general-purpose number generator: give it a range and a count, and it produces the numbers using the same cryptographic source as the rest of the site. It handles the awkward cases properly — negative ranges, steps, exclusions, decimals to a chosen number of places, and requests for more unique numbers than a range can supply.
It is useful anywhere you need unpredictability without hand-waving: sampling rows for a quality check, generating test data, running a classroom probability experiment, or picking numbers for a game.
How to use it
- Set the minimum and maximum.
- Choose how many numbers you need.
- Pick whole numbers or decimals — decimals let you set the number of decimal places.
- Add a step or an exclusion list if you need one.
- Decide whether repeats are allowed, and how the results should be ordered.
- Press Generate, then copy the numbers or download them as CSV.
How the random selection works
Whole numbers come from secureRandomInt(), which draws a 32-bit value from crypto.getRandomValues() and rejects any value that would fall outside a whole multiple of the range — the standard fix for modulo bias. Decimals are built from 53 random bits so that the full precision of a JavaScript number is used, then rounded to your chosen number of places. When you request unique numbers and the request covers a large share of the range, the generator enumerates the range once and partial-shuffles it, which is faster and avoids long rejection loops.
The full algorithm — including the rejection-sampling step and the wheel stop-angle calculation — is written out on the methodology page.
Practical examples
- Drawing 10 unique numbers between 1 and 49 for a game night.
- Generating 500 test values between 0 and 1 with four decimal places.
- Sampling 30 random row numbers from a 12,000-row export.
- Running a coin-bias experiment with a class by generating 1,000 values of 0 or 1.
- Producing random delays between 200 and 900 milliseconds for a simulation.
Available options
- Whole numbers or decimals with 1–10 decimal places.
- Steps, exclusions and negative ranges.
- Unique or repeatable results, up to 10,000 per draw.
- Sort ascending, descending, or keep draw order.
- Live statistics: count, lowest, highest, total and average.
- Copy, shuffle and CSV download.
Privacy
Nothing you enter here identifies you, and it is treated the same way regardless. Everything you type stays in this browser tab. There is no account, no upload step and no server-side copy of your list: the draw runs in JavaScript on your own device. Nothing is written to browser storage unless you explicitly save a list or tick the option to keep your draw history, and both can be cleared at any time from the privacy page.
Full details are in the privacy policy, which also has a button that deletes everything this site has stored in your browser.
Fairness and limitations
Every value in the eligible range has an equal probability, and the rejection-sampling step means that is exactly true rather than approximately true — a naive modulo would make the lowest numbers very slightly more likely. That said, the Web Crypto API is designed for unpredictability, not for statistical certification: these numbers are appropriate for games, sampling, teaching and testing, but a regulated lottery or a certified clinical randomisation needs an audited system, not a web page.
Frequently asked questions
What does “cryptographically secure” actually mean here?
It means the numbers come from your operating system’s entropy pool via crypto.getRandomValues(), so they cannot be predicted from earlier outputs. Math.random() offers no such guarantee, which is why it is only used as a fallback on browsers with no Web Crypto support.
Why was my request rejected?
The two common reasons are a minimum larger than the maximum, and asking for more unique numbers than the range can supply. Both produce an explicit message rather than a silently wrong result.
Are decimals uniform?
Yes, across the range you specify. They are generated from 53 random bits and then rounded, so rounding can very slightly cluster values at the endpoints if you choose few decimal places on a narrow range.
Can I use this for a real-money lottery?
No. This site is not a gambling service and the tool is not certified for regulated draws. Use it for games, teaching, sampling and testing.