Random Number Generator

Random number generator: pick random integers or decimals in any range, with or without duplicates, for draws, games, sampling. Free, runs in your browser.

Generate 1–100 integers.
Unique draws lottery-style picks without repeats.
Generated number—

Choose a range, then generate locally.

Ask an AI to explain this result
Share this tool

For casual decisions and simulations only. Not for regulated gaming, lotteries, audits, certifications, or cryptographic key generation.

This tool runs locally in your browser. Inputs and results are not transmitted or retained by BoringToolsKit.

Use this result

Share the current inputs or ask ChatGPT to explain the calculation in context.

More options
Report a calculation issue
Direct answer

What does this calculator estimate?

Random number generator: pick random integers or decimals in any range, with or without duplicates, for draws, games, sampling. Free, runs in your browser.

How crypto random draws are rejected and mapped to a fair die roll
Only 4 of 4294967296 raw draws get rejected for a fair roll.
Transparent methodology

How this calculator works

Frequently asked questions

What is a random number generator?

A random number generator is a tool that produces unpredictable numbers within a range you choose, using mathematical algorithms to ensure each number has an equal chance of appearing.

Do I need to create an account or sign up?

No, this random number generator runs entirely in your browser with no signup, no registration, and no data stored on any server.

Is the random number generator truly random?

It uses a pseudo-random algorithm, which is statistically unpredictable and fair for everyday use, but it is not suitable for cryptographic or security-critical purposes.

Cite this tool

BoringToolsKit. “Random Number Generator.” boringtoolskit.com/random-number-generator/. Free to reference in articles, syllabi, and answer posts with a link.

Privacy: Inputs and results stay in this browser. Any future sponsored recommendation or advertisement will be clearly labeled and kept separate from the calculation.

A worked draw, value by value

Set the range to 1 through 6, quantity 1, and the generator turns one 32-bit draw from crypto.getRandomValues into a fair die roll. The range span is 6. The script computes the largest multiple of 6 that fits in a 32-bit unsigned integer: 4294967296 divided by 6 is 715827882.67, so the floor is 715827882, and 715827882 x 6 = 4294967292. That value, 4294967292, is the acceptance limit. Raw draws from 4294967292 to 4294967295, just 4 of the 4294967296 possible values, are thrown away and redrawn, a rejection probability of about 0.000000093 percent. Skipping that step and mapping all 4294967296 values would bias the top of the range by roughly 1.6 percent.

Say the accepted draw is 19088743. The mapping is min + (n % span): 19088743 mod 6 leaves remainder 1, so the result is 1 + 1 = 2. Every accepted raw value maps to exactly one of the six outcomes, and each outcome owns exactly 715827882 raw values, so the roll is uniform. A wider range shows the same machinery: 100 through 999 gives span 900, an acceptance limit of 4294966500, and 796 rejected values, about 1.85 x 10^-7 of draws.

Where the tool refuses, by design

The input rules are hard walls, not warnings. Whole numbers only: 1.5 or 2.7 as a bound returns an error instead of being silently floored. Maximum must exceed minimum, so a zero-width range like 5 to 5 cannot produce a result. Quantity is capped at 100 per draw, and the span is capped at 1,000,000,000 integers, which still covers any practical use but stops someone entering 1 to 10^15 and stalling the browser on string formatting.

The unique mode has its own arithmetic wall. Asking for 101 unique values from a 100-value range fails immediately, since the pigeonhole principle makes it impossible, and the error states the exact conflict. Draws that are merely close to the wall, like 60 unique values from 1 to 100, succeed but need more raw values on average: after k values are taken, each new one has a (100 minus k) out of 100 chance of being fresh, so the last pick succeeds on average once per 41 raw draws when 99 slots are taken. The secure generator handles this by requesting fresh 32-bit batches up to 1,000 times, and returns a plain safety error rather than a biased shortcut if it still cannot fill the request.