Skip to content

Free Random Number Generator

This free random number generator instantly produces unbiased integers within any range you set — single picks, bulk batches up to 1,000, unique picks, or dice rolls. It uses your browser's Web Crypto API locally; the numbers and settings are not sent to FlipMyCase.

Quick Answer

What is this?

Generate random numbers with custom ranges. Bulk mode, no duplicates & dice roller. Free online random number generator — no signup.

Who needs it?

Teachers picking students, board game players rolling dice, and developers seeding randomized test data

Bottom line

Generates random numbers in any range, with bulk mode, no-duplicate option, and a dice roller

Dice Roller

What Randomness Source Does This Tool Use?

This tool uses crypto.getRandomValues(), the browser Web Crypto API method defined to return cryptographically strong random values. Browsers typically seed their generator from a high-quality operating-system entropy source. FlipMyCase does not receive the generated numbers.

The tool reads 64 random bits and uses rejection sampling before mapping the accepted value into your inclusive Min–Max range. Discarding the uneven tail avoids modulo bias, so a range such as 1–6 does not favor any die face.

It is appropriate for games, dice rolls, classroom picks, sampling, shuffles, simulations, and test data. A regulated drawing still needs its own documented rules, independent oversight, and auditable process. For passwords, API keys, tokens, or encryption keys, use a dedicated generator and the security controls required for that credential type.

The Modulo Bias Trap

A common mistake when mapping random bytes to a custom range is using the modulo operator (%). The problem: modulo produces bias unless your source space divides evenly into your target range. Consider mapping a random byte (0–255, so 256 possible values) to a die face (1–6). You might write result = (byte % 6) + 1. The byte values 0–251 map cleanly across six faces 42 times each. But 252, 253, 254, and 255 map to faces 1, 2, 3, and 4 respectively — giving those four faces one extra hit each. Faces 1–4 appear 43 times per 256 draws; faces 5–6 appear only 42 times. That is modulo bias.

The correct fix is rejection sampling: if the drawn byte falls in the biased tail (here, values ≥ 252), discard it and draw again. Repeat until you get a value in the unbiased portion. Each retry is independent, so the expected number of extra draws is tiny — less than one on average for most practical ranges. The result is that every outcome in your target range has exactly equal probability, with no skew toward the low end.

This tool handles the bias problem internally so you never have to think about it. Every number in your Min–Max range has equal probability regardless of how the range size aligns with the underlying random source.

Why Retry-on-Collision Fails for No-Duplicates

The obvious way to generate nunique random numbers is to generate one, check if you've seen it before, and retry if you have. This works fine when you need a handful of values from a large range — collisions are rare and retries are cheap. But performance degrades sharply as the count approaches the range size, for the same reason the birthday problem surprises people: once you've filled roughly 50% of the available slots, about half of all draws are collisions, so you're doing roughly two draws per accepted value. At 90% fill, nine out of ten draws are wasted. Near 100%, the retry loop runs for an arbitrarily long time and the behavior becomes unpredictable.

The Fisher-Yates shuffle sidesteps this entirely. It works by maintaining a virtual pool of all available values and swapping each selected value out of the pool permanently. Each draw is O(1) with zero chance of collision because you are always picking from the remaining unchosen values. The full algorithm runs in O(n) time — linear in the count you want — regardless of how close that count is to the range size. There is no retry logic and no worst-case blowup.

This tool uses Fisher-Yates for no-duplicates mode, which is why it handles requests like "999 unique numbers from 1–1000" just as quickly as "5 unique numbers from 1–1000."

How to Generate Random Numbers Here

1. Set your range. Enter a minimum and maximum value. The generator will produce numbers within this range (inclusive). Both positive and negative numbers are supported.

2. Choose single or bulk mode. Set Count to 1 for a single number, or increase it up to 1,000 for bulk generation. Single mode shows a large, prominent result; bulk mode displays all numbers in a compact grid.

3. Configure options.Toggle "No Duplicates" to ensure unique numbers. Choose ascending, descending, or unsorted order. The tool remembers your preferences between visits.

4. Roll dice. Use the dice roller section to simulate standard RPG dice. Click any die button to roll it, and view your complete roll history. Copy or clear results anytime.

Technical Sources

The implementation and explanations above are checked against these primary standards:

Implementation and sources last reviewed July 18, 2026.

Frequently Asked Questions About Random Number Generator

How does this random number generator work?

This tool uses the browser Web Crypto API's crypto.getRandomValues() method. It maps 64 random bits into your requested range with rejection sampling so every integer has the same probability.

Can I generate numbers without duplicates?

Yes. Toggle the 'No Duplicates' option to ensure every generated number is unique. If your count exceeds the possible unique numbers in your range (e.g., requesting 200 unique numbers between 1 and 100), the tool will cap at the maximum possible unique values.

What is the maximum number of random numbers I can generate at once?

You can generate up to 1,000 numbers in a single batch. This is enough for most practical uses including simulations, statistical sampling, and lottery-style drawings. The results can be sorted ascending, descending, or left unsorted.

How does the dice roller work?

The dice roller simulates standard tabletop RPG dice: d4 (4-sided), d6 (6-sided), d8, d10, d12, and d20. Each click generates a random result between 1 and the number of sides. Roll history is kept so you can track your results.

Is this truly random?

It uses the cryptographically strong random values supplied by your browser and operating system. That is stronger than Math.random(), but no website can independently prove the quality of a device's underlying entropy source.

Can I use negative numbers?

Yes. Both the Min and Max fields accept negative numbers. For example, you can generate random numbers between -100 and 100, or between -50 and -1. The only requirement is that Min must be less than or equal to Max.

Is my data sent to a server?

No. All random number generation happens entirely in your browser using JavaScript. Nothing is sent to any server. Your settings are saved to your browser's local storage for convenience.

Can I use this for passwords or security tokens?

Use a dedicated password or key generator instead. This tool uses the Web Crypto API, but its integer output, visible history, and copy workflow are not a substitute for the correct length, format, storage, rotation, and handling required for credentials or cryptographic keys.

Why might my random numbers look biased?

If you map raw random values to a range using the modulo operator (%), you can introduce modulo bias — values at the low end of your range appear slightly more often than the rest. For example, mapping a random byte (0–255) to 1–6 with %6 over-represents 1 through 4 because 256 does not divide evenly by 6. This tool avoids bias by using rejection sampling internally, discarding any draw that falls in the uneven tail and retrying, so every value in your range has equal probability.

Related Free Online Tools

Generate random numbers here, then explore our other utility tools.