What Is This Random Number Generator
This random number generator selects discrete values from a user-defined inclusive range. Integer mode includes every whole number from the ceiling of the lower limit through the floor of the upper limit. Decimal mode turns the range into equally spaced slots at the selected number of decimal places, then returns the exact slot labels.
The page can create one value or a batch of up to 200, allow or prevent repeats, retain original draw order, sort the display, and optionally reproduce a batch with a seed. A complete ledger keeps every returned value visible instead of hiding a long batch behind an abbreviated summary.
How to Use the Random Number Generator
- Choose Integer for whole-number picks or Decimal for fixed-precision values.
- Enter lower and upper limits. Both ends are included after the selected mode is applied.
- Set the batch size from 1 through 200 and, in Decimal mode, choose 0 through 50 decimal places.
- Allow repeats for independent draws or select Unique values only to sample without replacement.
- Keep Generated order when sequence matters, or sort the displayed ledger ascending or descending.
- Leave the seed blank for Web Crypto, or enter a seed only when a repeatable demonstration or software test is required.
- Select Generate numbers and review the full ledger, source label, duplicate audit, median, sum, average, and range size.
Choose Integer or Fixed-Precision Decimal Mode
Integer mode answers questions such as picking a whole number from 1 through 100. If a boundary contains a fraction, the calculator uses only whole numbers inside the entered interval: 0.2 through 112.5 becomes the inclusive integer range 1 through 112. The result reports both the entered limits and the range actually used.
Decimal mode is not a continuous real-number draw. At two decimal places, 0.20 through 0.25 contains six equally spaced slots: 0.20, 0.21, 0.22, 0.23, 0.24, and 0.25. At 50 places, each step is 10^-50. A boundary with more fractional digits than the selected precision is rejected rather than silently rounded or truncated.
| Settings | Discrete values used | Possible slots |
|---|---|---|
| Integer, 1 to 6 | 1, 2, 3, 4, 5, 6 | 6 |
| Integer, 0.2 to 3.8 | 1, 2, 3 | 3 |
| Decimal, 0.20 to 0.25, 2 places | 0.20 through 0.25 by 0.01 | 6 |
| Decimal, -0.1 to 0.1, 1 place | -0.1, 0.0, 0.1 | 3 |
Inclusive Limits and Equal Discrete Slots
Both boundaries are inclusive. Therefore, an integer range from a through b contains b - a + 1 values. Decimal mode first multiplies both exact boundaries by 10^p, where p is the selected precision, and then applies the same inclusive integer-slot count. This avoids ordinary binary floating-point drift in the range map.
Each selectable slot has the same probability on one unseeded draw. The page uses rejection sampling instead of reducing an arbitrary random integer with a modulo operation. Rejection discards candidates outside the largest evenly representable interval, preventing the early slots from receiving an extra mapping.
Web Crypto and Repeatable Seeded Output Are Different
With a blank seed, the calculator requests random bytes from the browser Web Crypto API. The W3C specification describes getRandomValues as producing cryptographically strong random values. The page then maps those bytes to the chosen range with rejection sampling, and it identifies that source in the result.
Entering a seed deliberately switches to a deterministic pseudo-random sequence. The same seed and settings reproduce the same batch, which is useful for examples, debugging, lessons, and repeatable test fixtures. This small local seeded generator is not cryptographically secure and must not be used for passwords, keys, tokens, regulated drawings, gambling, or security decisions.
Unique Values Use Sampling Without Replacement
Allow repeats models independent draws: a value can appear again because every draw uses the full range. Unique values only models sampling without replacement: after a slot is selected, it cannot be selected again in that batch. The calculator rejects a unique request larger than the number of available slots.
Large ranges are handled without building an array containing every possible value. A partial Fisher-Yates mapping stores only the positions touched by the requested batch. Memory therefore grows with the maximum 200 requested values, not with a range that may contain millions or hundreds of digits.
Generated Order and Sorted Order Answer Different Needs
Generated order preserves the sequence in which values were selected. Ascending and descending options sort only the displayed batch; they do not rerun the generator or change which values were drawn. The ledger retains each value's original draw position so sorted output remains auditable.
Keep generated order for randomized assignments, test sequences, turn order, or any task where position has meaning. Sort the display when scanning for duplicates, reviewing coverage, finding extremes, or copying an ordered list is more important than chronology.
Random Number Generator Examples
For ten unique integers from 1 through 100, the range contains 100 slots and the batch occupies 10% of them. Every result must be a whole number inside the inclusive limits, the unique count must equal ten, and duplicate positions must equal zero. The exact values change when no seed is used.
For five decimals from 0.20 through 0.25 at two places, there are six slots. With repeats allowed, a value may occur several times. With unique values selected, a request for six succeeds and necessarily returns every slot in some order, while a request for seven is rejected.
| Request | Invariant to verify | Expected audit |
|---|---|---|
| 20 unique integers, 1 to 1,000 | Every value is 1-1,000 | 20 unique, 0 duplicate positions |
| 6 unique decimals, 0.20 to 0.25 | Every two-place slot appears | 6 possible and 6 selected |
| 4 integers, -2.8 to 2.8 | Only -2, -1, 0, 1, 2 | Integer range used is -2 to 2 |
| Seed demo-7 used twice | Same settings reproduce the batch | Source labeled seeded, not Web Crypto |
How to Audit the Generated Result
Start with the mode-adjusted range and possible-value count. Confirm every ledger value falls inside that range and carries the requested decimal places. Compare values requested, unique values returned, duplicate positions, and repeated distinct values. In unique mode, the first two counts must match and both duplicate measures must be zero.
The minimum, maximum, median, sum, and average describe only the returned batch. They do not prove that the generator is fair: a valid random batch can be clustered, unbalanced, or contain repeats. Statistical behavior is evaluated over appropriately designed repeated trials, not by expecting every small batch to look evenly distributed.
Random Number Generator Features
- Integer and fixed-precision decimal modes in one workspace.
- Inclusive lower and upper limits with up to 200 digits per boundary.
- One to 200 values per batch and zero to 50 decimal places.
- Independent draws with repeats or bounded-memory unique sampling without replacement.
- Generated, ascending, and descending display order with original positions retained.
- Web Crypto source by default and an explicitly insecure repeatable seed option.
- Complete paginated ledger, duplicate status, range coverage, median, sum, and average.
- Copy and downloadable result actions with no account requirement.
Benefits of a Transparent Random Number Picker
A transparent random number picker distinguishes the random source, range mapping, replacement rule, and output order. Those labels prevent common mistakes such as assuming unique picks are independent, treating a sorted list as original draw order, or believing a repeatable seed is secure.
Arbitrary-size integer arithmetic also avoids losing exact boundaries above JavaScript's ordinary safe-integer limit. The full ledger and summary checks make the batch easier to review, copy, explain, and reproduce when a seed is intentionally used.
Common Random Number Generator Use Cases
- Create sample values and boundary cases for software or spreadsheet testing.
- Pick classroom prompts, practice questions, turn order, or non-sensitive group assignments.
- Generate casual game values when a dedicated dice model is unnecessary.
- Sample unique item numbers without constructing a full large-range list.
- Create repeatable demonstrations and test fixtures with a disclosed seed.
- Generate fixed-precision decimal inputs for simulations whose model is defined elsewhere.
Accuracy, Security, Privacy, and Trust Limits
The implementation is designed to map random bytes uniformly to the stated discrete range and to preserve exact large integer boundaries. That does not certify the browser, operating system, device entropy source, or complete environment. It also does not make one batch evidence of randomness, guarantee a desired distribution across a small sample, or validate a simulation model.
Use an independently audited system with documented procedures, access control, records, and applicable oversight when money, prizes, admissions, research assignment, gambling, legal rights, regulated lotteries, or public trust is involved. Never use the seeded mode for security. Inputs and calculations run in the current browser and require no account.
Randomness and Web Crypto References
These primary references support the page's distinction between strong browser randomness, deterministic generators, entropy, rejection-based range mapping, and security limits. They do not audit this website or certify a particular drawing.