Generate uniform integers within inclusive bounds, allowing repeats or sampling without replacement using browser randomness.
How to use this tool
- Choose the event or model and review the assumptions below.
- Enter the labeled inputs.
- Select Generate and read the labeled outputs.
- Change an input and calculate again; Reset restores the example inputs.
Calculation method
Uniform integer sampling uses browser cryptographic random words with rejection of the incomplete range. Sampling without replacement keeps each remaining integer equally likely.
Assumptions and limits
Inclusive integer bounds within ±10¹²; span at most 10⁹; output at most 1,000 values. A random sample, not a reproducible seeded audit or a security-key generator. No external random-number API is called.
Worked example
Bounds 1 through 10 contain ten possible integers. Without replacement, ten requested outputs include every value exactly once in random order; eleven outputs are not permitted.
Worked reading and practical questions
- Inclusive Random-Integer Bounds and Off-by-One Errors
- Random Sampling Without Replacement: Unique Does Not Mean Independent
Browse Statistics calculators or explore other tools on the GreenCalc homepage.
Frequently asked questions
What does this simulation assume?
Inclusive integer bounds within ±10¹²; span at most 10⁹; output at most 1,000 values. A random sample, not a reproducible seeded audit or a security-key generator. No external random-number API is called.
How do I enter and update the inputs?
Use the labeled fields, then select Generate. Percent fields use 0 to 100. After editing, calculate again; Reset restores the example inputs.
