Random number generator: method, examples and limits
Enter plain numbers without grouping separators or scientific notation. Whole-number limits are required in integer mode; decimal mode uses a fixed grid.
Choose a range, quantity and output
Enter the smallest and largest allowed values, select integers or decimals, and choose how many numbers to generate. Limits are inclusive when they lie on the selected grid. Use No repeats when every selected number must be different, then choose draw order or numeric sorting. For six distinct entry numbers from 1 to 49, set those limits, quantity 6, No repeats, and Lowest first. A different set on the next click is expected, but a repeated set is also possible. Download CSV for a spreadsheet or text for one number per line.
Uniform sampling and the integer formula
For inclusive integer limits a and b, there are N = b − a + 1 eligible values. The generator obtains bytes from Web Crypto, masks them to a power-of-two domain, rejects candidates outside 0 to N − 1, and returns a + the accepted rank. This rejection step prevents the uneven remainder that a simple modulo operation can introduce. For 1 to 6, each face has a first-draw probability of 1/6. These are pseudorandom values produced by the browser’s security-oriented generator, not measurements of atmospheric noise. This page is a sampling tool, not a key-generation or audited-draw service.
N = b − a + 1; P(x) = 1 / N
Exact decimals on a finite grid
A computer cannot choose uniformly from every real number in a continuous interval. This tool instead chooses uniformly from a stated decimal grid. With d decimal places, it samples integer ranks from ceil(a × 10^d) through floor(b × 10^d), then divides the selected scaled integer by 10^d. For 1.00 to 2.00 at two places, all 101 grid values have equal first-draw probability; values are not generated as floating-point fractions and then rounded. Limits 0.101 and 0.129 at two places permit only 0.11 and 0.12. If the chosen precision leaves no eligible value, the tool reports an error.
L = ceil(a × 10^d); U = floor(b × 10^d); N = U − L + 1; x = k / 10^d
Repeats, unique draws and sorting
With repeats allowed, each selection uses the same complete pool independently. Duplicates can therefore occur even in a short list. No repeats uses a sparse partial shuffle: a selected rank is removed before the next selection, without building an enormous array of the entire range. You cannot request more unique values than the pool contains. At two decimal places, −0.02 through 0.02 has exactly five eligible values: −0.02, −0.01, 0.00, 0.01 and 0.02. Drawing all five uniquely returns those five values in a random order; sorting only rearranges the final list.
d = 2: {−0.02, −0.01, 0.00, 0.01, 0.02}; N = 5
Large numbers, precision and summaries
Bounds and selected values use exact integer arithmetic. Each limit accepts at most 1,000 digits in total, with at most 100 fractional digits; decimal output supports 0 to 100 places. Each draw supports 1 to 10,000 numbers, subject to a conservative 1,000,000-character output budget based on the widest eligible value. The result shows the eligible endpoints, pool size, step, selected minimum and maximum, and the exact arithmetic mean of the generated list. This mean is a property of this sample, not a guarantee that every draw will balance around the range midpoint. Results are bounded in memory, and only the first 200 are previewed.
x̄ = (x₁ + x₂ + … + xₙ) / n
Exports, privacy and sensible uses
Copy, CSV and text downloads contain the full draw, even when the on-screen preview is shorter. Print / Save as PDF includes the complete list and its settings; large draws can produce many pages. CSV applications may round long integers or decimals, so import the number column as text or keep the text download when every digit matters. Generate classroom examples, game rolls or numbered samples after deciding the eligible range. This tool does not keep a draw history, certify winners or make an externally verifiable record. Inputs and results remain in the current tab, so download before leaving.
For expressions with powers and functions, use Scientific Calculator. For exact fraction arithmetic, use Fraction Calculator.
The W3C Web Cryptography API defines the browser random-byte interface. The finite-grid sampling method is explained above; this page is not a certified random-number service.
Common questions
Are the lower and upper limits included?
Yes for integer limits. In decimal mode, only values on the selected decimal grid are eligible. An endpoint is included when it lies on that grid; off-grid endpoints are narrowed inward using exact ceiling and floor operations.
Why can a fresh draw repeat a number or an earlier result?
Random selection does not promise different outcomes on consecutive clicks. Allow repeats permits duplicates within the same draw. No repeats prevents duplicates inside that draw only; the next click starts with the complete original pool.
Can decimal results be unique without rounding collisions?
Yes. Decimal values are represented as exact scaled integers and selected without replacement. If there are too few distinct grid values, the request is rejected instead of returning a shorter list or silently repeating values.
Can I enter a seed or reproduce an earlier draw?
This version uses fresh Web Crypto bytes and has no seed control. Copy or download the result to retain it. A saved list records the generated values but is not an independent audit of how a draw was conducted.
Does sorting affect which numbers are selected?
No. The complete list is sampled first, then sorted by exact numeric value if requested. Ascending or descending order changes how the selected values are displayed, not which values were drawn.
Explore related tools
- Percent Error Calculator
- Scientific Calculator
- Fraction Calculator
- Percentage Calculator
- Math calculators