Define an inclusive integer range
A range-based draw needs an integer minimum, integer maximum, and endpoint rule. NumUtility includes both endpoints. The eligible count is maximum−minimum+1, so 4 through 9 contains six outcomes: 4, 5, 6, 7, 8, and 9. Write a small eligible set before trusting a formula.
The minimum may be negative, zero, or positive, but it cannot exceed the maximum. Do not silently swap reversed inputs or round decimal inputs because either action changes the requested population. A one-value range is valid, although it contains no uncertainty.
Map secure random data without bias
For an ideal uniform u where 0≤u<1, floor(u×(max−min+1))+min maps equal-width intervals to eligible integers. Multiplication creates one interval per outcome, floor selects its zero-based offset, and adding min shifts the result into the chosen range.
A finite random source needs extra care. If its possible source values are not divisible evenly by the range size, taking a simple remainder gives some outcomes more source values. Rejection sampling discards the incomplete tail before taking a remainder. A cryptographically strong source plus unbiased mapping supports unpredictable, uniform draws.
Three complete examples
Input: minimum 1, maximum 6. Formula: count=6−1+1. Calculation: six offsets 0–5 map to 1–6. Result: one integer from 1 through 6. Interpretation: this models one die roll when offsets are uniform.
Input: minimum −3, maximum 3. Formula: count=3−(−3)+1=7. Calculation: offsets map to −3,−2,−1,0,1,2,3. Result: one of seven integers. Interpretation: zero and both endpoints are eligible.
Input: minimum 25, maximum 25. Formula: count=25−25+1=1. Calculation: offset zero plus 25. Result: 25. Interpretation: every valid draw returns the sole eligible value.
Understand uniformity and repeats
Uniform means every eligible integer has the same probability on a valid draw. It does not require a short sequence to look balanced. Ten die-style draws may repeat one value and omit another without proving bias. Independence also allows consecutive repeats.
If unique outcomes are required, use sampling without replacement rather than repeatedly drawing and hiding duplicates. The procedure, population, and stopping rule should be stated. A repeated result is not a malfunction in an ordinary with-replacement range generator.
Check probability and implementation limits
For n equally likely integers, any specified result has probability 1/n; a subset of k eligible integers has probability k/n. From 1–10, five results are even, so the probability is 5/10. From 1–9 it is 4/9, not one half.
Verify every output is an integer satisfying min≤result≤max. Very large ranges can exceed a software number format's exact-integer capacity, so stay within validated tool limits. Frequency tests can reveal severe errors but a small passing sample cannot certify cryptographic security.
Avoid misleading fairness claims
Forgetting +1 excludes the maximum; rounding instead of flooring gives interior outcomes wider intervals. A fair algorithm also cannot repair a manipulated entrant list or selective redraw. Fairness describes the complete process, not the appearance of one output.
A seed can reproduce simulations but a predictable public seed is unsuitable when unpredictability is required. NumUtility is not a certified gambling device, key generator, or witnessed lottery system. Regulated and high-stakes uses require independent technical, legal, and audit controls.
An exclusive upper-bound formula uses max−min outcomes and is valid only when max must never appear. Copying it into an inclusive calculator creates an off-by-one error. Label interval notation and test both endpoints with controlled cases during implementation review.
For simulations, document whether draws are with replacement, the number of trials, and any seed. Reproducibility and unpredictability serve different goals: a scientific sequence may need a disclosed seed, while a contest should not use a seed that entrants can exploit.
Do not infer patterns from recent outputs. The gambler's fallacy treats an omitted number as due, but independent uniform draws keep its next-draw probability at 1/n. Likewise, a streak does not prove manipulation without evidence about the process.
Range size affects individual probability directly. From 10 through 19 there are ten outcomes, not nine, because both 10 and 19 count. Each has probability 10%. Expanding the maximum to 20 creates eleven outcomes and changes each probability to 1/11. Recalculate the count whenever either boundary changes rather than reusing an earlier percentage.
A random integer generator differs from a random decimal generator. If every real number in an interval were considered, there would be infinitely many possibilities and the probability of one exact real value would not be modeled as 1/n. NumUtility deliberately selects whole numbers, so labels and examples should retain the integer requirement.
In a classroom experiment, decide whether the generated number represents an observation or an index. If students are numbered 1–30, a draw selects an index tied to a roster. If roster numbers contain gaps, the continuous range includes invalid positions. A custom list avoids repeated redraws and preserves the true eligible population.
For software testing, include boundary cases: equal endpoints, zero crossing, two-value ranges, negative-only ranges, and the largest supported magnitudes. A result inside bounds is necessary but not enough; tests should also inspect endpoint reachability and the mapping logic. Never run millions of production draws merely to infer code correctness when the implementation can be reviewed directly.
When publishing results, state the range before the number. Writing only “the result was 8” does not reveal whether 8 came from 1–10, 1–100, or a custom population. Context makes probability and eligibility auditable. If settings change between rounds, record every round separately instead of merging outcomes under one unlabeled list.
Use the Random Number Generator
Enter whole-number endpoints and generate. The browser-based tool includes both endpoints and supports negative integers. Record the range, time, and result when an ordinary decision needs a traceable note.
Before using a result, confirm the intended population really is every integer in the range. A custom list with gaps needs the Random Number Picker instead. The generator cannot determine eligibility, interpret regulations, or guarantee that a device is uncompromised.
A range can encode labels only when the mapping is fixed before the draw. For four teams, document 1=North, 2=South, 3=East, and 4=West, then generate 1–4. Assigning labels after seeing the result defeats the selection. Save the mapping with the output whenever the number itself is not the final meaning.
When several random integers are needed, decide whether order matters. A sequence of three independent draws from 1–10 permits repeats and has 10³ ordered possibilities. Three distinct selections without replacement have 10×9×8 ordered possibilities. Sorting the outputs afterward removes visible order but does not turn one sampling design into the other.
Privacy is usually low risk for bare numeric ranges, but the meaning attached to a number may identify a person or record. Do not publish a roster mapping merely to prove that the generator returned a valid integer. Share the method and masked evidence while limiting access to sensitive source data.
A final pre-use checklist is short: confirm integer inputs, inclusive endpoints, supported magnitude, correct population model, and whether repeats are allowed. After generation, confirm the output lies inside the recorded range and preserve context proportionate to the decision. These checks catch specification mistakes that no random source can detect.