Free tool
Random Number Generator
Math.random() function most free generators quietly rely on, so the numbers you get are uniformly distributed with no bias toward any value in your range, and nothing you type is ever sent to a server. If you specifically need a single number picked one at a time with a spinning-wheel animation, see the random number wheel instead; if you want the technical explanation of what "true" randomness actually means, see true random number generator. Generated with the Web Crypto API (cryptographically secure, unbiased) in your own browser: nothing you enter is ever sent to a server.
How to use this random number generator
Three fields control every draw:
- Min and Max: the inclusive range the number (or numbers) will be drawn from. Both fields accept negative numbers, so a range like -10 to 10 works exactly as expected.
- How many numbers: 1 for a single pick, up to 1,000 for a large batch (a sample for a statistics exercise, a big list of test IDs, and so on).
- Number type, sorting and duplicates: choose Integer or Decimal (with 1 to 6 decimal places), whether results should be sorted, and whether repeats are allowed. All three are explained in detail below.
Integer vs. decimal numbers
Integer mode returns whole numbers only, which covers the vast majority of everyday uses: picking a winner, rolling a die, choosing a lucky lottery-style number, or generating sample IDs. Decimal mode returns numbers with a fractional part, useful for simulating measurements, generating realistic-looking test data (prices, sensor readings, percentages), or any exercise that specifically calls for non-whole numbers. Decimal mode lets you choose between 1 and 6 digits after the decimal point; internally, the generator scales your range by that precision and draws an unbiased integer in the scaled space before dividing back down, so the extra decimal digits are just as uniformly distributed as a plain integer draw would be.
Worked example: picking a raffle winner from 45 tickets
Set Min to 1 and Max to 45, leave How many numbers at 1, and click Generate. The single number returned corresponds to the winning ticket. If ticket numbers don't start at 1, just adjust Min and Max to match your actual numbering (for example, 100 to 145) and the draw stays exactly as fair: every ticket in the range has an identical chance of being chosen, regardless of how the range is offset.
Worked example: drawing a sample of 20 unique numbers from 1 to 500
Set Min to 1, Max to 500, How many numbers to 20, and turn on "No duplicates (unique numbers)". This is the setup for a simple random sample: 20 distinct numbers drawn from a population of 500, with no repeats and every possible group of 20 equally likely to appear. Turn on Sort (ascending) afterward if you want the sample numbers listed in order rather than in draw order, which many people find easier to cross-reference against a spreadsheet.
Worked example: a decimal number between 0 and 1
Set Min to 0, Max to 1, switch Number type to Decimal, and choose 4 decimal places. This mirrors what a programming language's default random function usually returns (a uniform value in the unit interval), which is handy for spreadsheet formulas, probability demonstrations, or seeding a manual Monte Carlo-style estimate without writing any code.
What "no duplicates" actually changes
With duplicates allowed (the default), each of the requested numbers is drawn completely independently, exactly like rolling a die multiple times: the same value can come up more than once, and in a small range with a large count it usually will. Turning on "No duplicates" instead draws a genuine sample without replacement: once a number has been picked, it's removed from the pool for the rest of that batch, so every number in the results is guaranteed distinct. This only works if the range is large enough to hold the requested count (you can't draw 10 unique numbers from a range of 5), and the tool shows a clear message rather than a wrong or partial result if you ask for more unique numbers than the range can supply.
Sorting your results
By default, results are shown in the order they were drawn. Switching Sort to Ascending or Descending re-orders the final list numerically without changing which numbers were drawn or how fair the draw was: sorting happens purely as a display step, after the random selection is already complete. This matters for lottery-style number sets, where players conventionally expect their numbers listed smallest-to-largest, and for statistics samples that are easier to scan or paste into a spreadsheet in order.
Why this generator uses the Web Crypto API instead of Math.random()
Most free random number tools on the web are built on JavaScript's built-in Math.random() function: fast, but not cryptographically secure, and prone to a subtle bias ("modulo bias") when its output is naively squeezed into an arbitrary range. This generator instead uses crypto.getRandomValues(), the Web Crypto API's cryptographically secure random number source, combined with rejection sampling (redrawing any value that would introduce bias) to guarantee every number in your chosen range has a genuinely equal chance of appearing. You can verify this yourself: it's a standard, MDN-documented browser API, not a proprietary claim. See true random number generator for a full, honest comparison between Math.random(), the Web Crypto API used here, and the hardware entropy sources (like atmospheric radio noise) that dedicated "true random" services use.
Common uses for a random number generator
The same min/max/count/unique controls cover a wide range of everyday situations:
- Picking a winner: raffles, giveaways, contests, and drawings, where a single fair pick from a numbered range is all that's needed.
- Games and decisions: settling a tie, simulating a die roll (Min 1, Max 6) or a coin flip (Min 1, Max 2), or choosing who goes first.
- Statistics and research: drawing a random sample without replacement (unique numbers on) from a numbered population for a survey, an audit, or a classroom exercise.
- Testing and development: generating batches of sample IDs, dummy record numbers, or decimal test values for QA and demos, without wiring up a script.
- Password and PIN components: a decimal or integer draw can supply the numeric portion of a password, though a dedicated password generator is a better fit for a full random password.
- Icebreakers and team activities: a random number can assign speaking order, table seating, or turn order for a group activity, quickly and visibly fairly, without anyone feeling singled out by a human picking names.
- Lottery-style number sets: a batch of unique numbers, sorted ascending, in the format most lottery games expect.
Comparing common ways to pick a random number
This generator is one of several practical ways to get a random number, and each has a genuinely different trade-off worth knowing about:
- This generator (Web Crypto API): unbiased, unlimited draws, up to 1,000 numbers at once, decimals and no-duplicates supported, runs entirely in your browser, free with no account.
- A typical free online generator (plain Math.random()): usually fine for casual use, but can carry a small statistical bias toward certain numbers in the range, and rarely offers decimals, uniqueness, or batch draws.
- Physical dice or a coin: genuinely random and needs no device, but limited to the ranges a physical object naturally provides (1 to 6, 1 to 2) and impractical for a batch of 50 unique numbers.
- A hardware entropy service like RANDOM.ORG: the strongest randomness guarantee available (atmospheric noise, not an algorithm), typically rate-limited per day for free use and slower than an instant in-browser draw. See the true random number generator page (linked below) for the full three-way comparison of randomness sources.
- Rolling your own script (Math.random() in raw JavaScript): flexible, but easy to get subtly wrong. A naive "Math.floor(Math.random() * n)" implementation, without care, can under- or over-represent specific numbers depending on the range size, exactly the bias this tool's rejection-sampling approach avoids.
If you just want one number, quickly
Searching for "number generator" instead of the full phrase? The number generator page is the same tool with quick-start range presets (1 to 10, 1 to 100, 1 to 1000) for a fast single pick with no setup. For a spinning-wheel style pick instead of a plain result, try the random number wheel.
Frequently asked questions
Is this random number generator really free?
Is the result actually random, or biased toward certain numbers?
Can I generate negative numbers?
What happens if I ask for more unique numbers than the range allows?
Does this tool store or send my numbers anywhere?
How many numbers can I generate at once?
Can I get decimal numbers instead of whole numbers?
How is this different from RANDOM.ORG's true random number service?
Can I copy the generated numbers to use elsewhere?
Ready to generate a number?
Cryptographically secure randomness, right in your browser.
Go to the generatorFree. No account needed.