Worked example: Random Number Generator
Fixed interval. This fixed reference example shows one complete scenario; the interactive results above use your current inputs.
View the example inputs
- Minimum inclusive
- 7
- Maximum inclusive
- 7
- Count
- 3
- Number type
- Whole numbers
- Allow duplicate values?
- Yes — with replacement
- Result order
- Keep draw order
| Calculated quantity | Example result |
|---|---|
| numbers | 7, 7, 7 |
| count | 3 |
| pool | 1 |
Random Number Generator: make the sampling rule visible
How do I generate a random number between two limits?
Choose inclusive minimum and maximum bounds, select a number type and press Generate. In integer mode, every whole number in the interval is eligible. From 1 through 6, that gives six possibilities and a first-draw chance of 1/6 for each. A new Generate action creates a new batch.
The Random Number Generator uses Web Crypto random words with rejection sampling. This avoids the small bias created by simply taking a remainder from a random range that does not divide evenly into the requested pool. The complete outcome pool and its grid step are shown below the results.
How can I generate random numbers without duplicates?
Select “No — without replacement.” Every chosen value is removed from the eligible pool for that batch, and the requested count must fit inside the pool. Asking for five unique integers between 1 and 4 is impossible and produces an input error.
Without replacement, the draws are dependent: once a value is selected, it cannot be selected again. With replacement, each draw keeps the same chance for each eligible value and repeats are normal. Neither rule is universally better; they describe different sampling tasks.
How are random decimal numbers generated?
Decimal mode samples a fixed grid at the selected number of decimal places. From 0.10 to 0.12 at two places, the eligible outcomes are 0.10, 0.11 and 0.12. These three values have equal first-draw probability; the tool does not pretend to choose from infinitely many real numbers.
A bound is included only if it lies on the grid. At two places, limits 0.111 and 0.129 allow 0.12 only. The pool table shows the actual eligible endpoints, which may lie inside the entered bounds. Displayed decimals retain trailing zeros so the selected grid is visible in results and exports.
Does sorting random numbers change the sample?
Ascending or descending sorting changes presentation after the draw. It does not select another set of outcomes or make the smallest value more likely to have been chosen. The complete table numbers displayed positions; after sorting, those positions no longer identify the original drawing order.
For a classroom allocation, retain draw order when position assigns a role. For a checklist of selected item numbers, ascending order may be easier to read. Choose the ordering before generating if you need an exported batch with that presentation; changing a setting clears the old result rather than silently mixing settings and outputs.
Why do random results sometimes look uneven?
A small batch does not have to divide evenly among eligible values. With replacement, repeats and gaps are expected possibilities. The observed-frequency chart summarizes what actually appeared; it is not a guarantee that future draws will fill the missing values or balance previous results.
The chart previews up to 30 observed distinct values, and the table preserves the full observed frequency distribution. Unobserved values are not listed as though their probability were zero. Each batch frequency table sums to its generated count, and the complete batch CSV preserves every generated outcome.
What can I use this Random Number Generator for?
Use it for classroom number selection, simple game setup, generating test data or sampling numbered items from a known pool. Keep an external record if the selection must be explained later: this tool does not provide an audited drawing service or prove which settings someone used.
Ordinary browser generation happens when you press Generate; sharing copies the settings, not the generated batch. Download results to retain the exact outcomes. Even though Web Crypto supplies the random words, this interface is not a complete password, cryptographic key or legally regulated prize-draw protocol.
Formula and calculation method
Random words come from Web Crypto. Rejection sampling discards the incomplete part of the integer range before taking a remainder, avoiding modulo bias.
Bounds are inclusive for eligible grid values. Decimal mode uses a finite grid at 0–6 decimal places, not continuous real numbers.
Without replacement, a partial shuffle selects unique values without repeatedly retrying already drawn values. Sorted output is the same selected sample in a different order.
The form runs only when Generate is pressed. Shared links restore settings, not a previous random batch; download the results to retain a batch.
Scope and Limitations
- Bounds from −10⁹ to 10⁹ and at most 1,000 draws. This tool does not provide arbitrary precision, a reproducible seed, audited prize-draw records, or a complete key/password-generation protocol. An observed sample need not look evenly spread.
Reference Sources
Frequently asked questions
Are the minimum and maximum included?
Integer endpoints are inclusive. In decimal mode, only values on the selected grid can be generated; the pool table shows the actual eligible endpoints.
Can I prevent repeated numbers?
Yes. Disable duplicates and choose a count no larger than the eligible pool.
Can a shared link reproduce my random batch?
No. It restores the settings. Download the generated results to keep the exact batch.
Does this support hundreds of digits of precision?
No. It supports bounds up to one billion in magnitude, at most six decimal places and up to 1,000 draws, with explicit grid-based decimal sampling.
Are the frequency bars a randomness certification?
No. They describe one generated batch; uneven samples and repeated values can occur in valid random sampling.