Random Integer Generator
Random Integer Generator chooses a whole number between the normalized minimum and maximum, including both endpoints. Decimal inputs are rounded inward: the minimum is rounded up and the maximum down. It is useful for informal samples, games, and test values, but it does not expose a seed or provide cryptographic or auditable randomness.
Runs locally — files stay on your deviceIs the maximum included in the random integer range?
Yes. Both the minimum and maximum integer endpoints are eligible.
An inclusive discrete interval contains whole-number outcomes
For minimum m and maximum M, the eligible set is m, m+1, …, M. There are M−m+1 possible integers when m≤M.
How it works
Enter the smallest and largest allowed values. Check whether you want inclusive endpoints and whether decimal limits should be rounded inward before using the result.
Key concepts
Inclusive endpoints change the count
The integers from 1 through 10 contain ten outcomes, not nine.
Integer generation is discrete
There are no values such as 2.5 between eligible outcomes.
When to use it
- Generate an informal number for a game.
- Choose a list position from a known integer range.
- Create varied test input that need not be reproducible.
When not to use it
- Do not use it for passwords, keys, gambling, or regulated lotteries.
- Do not expect the same sequence to be reproducible.
- Do not enter a maximum below the normalized minimum.
Worked examples
One to six
- Input
Minimum 1; maximum 6- Expected output
One of 1, 2, 3, 4, 5, 6
This has the same labels as one six-sided die.
Negative range
- Input
−3 through 2- Expected output
One of six integers
Zero and both endpoints are included.
Decimal limits
- Input
1.2 through 5.8- Expected output
Integer from 2 through 5
The minimum rounds up and maximum rounds down.
Common mistakes
Assuming an exclusive maximum
The maximum can be selected. Correction: Adjust the entered maximum if exclusivity is required.
Counting outcomes as max minus min
That omits one endpoint. Correction: Use max − min + 1.
Using it for security tokens
The operation is not presented as a cryptographic token generator. Correction: Use Random Token Generator or an appropriate security system.
Best practices
- Document whether endpoints are inclusive.
- Use integer limits explicitly.
- Use a seeded test framework when reproducibility matters.
Related operations and differences
Random Decimal Generator
Choose Random Decimal Generator when you need to generate a decimal inside a chosen range.; use Random Integer Generator specifically for integer.
Coin Flip
Choose Coin Flip when you need to flip a virtual coin locally.; use Random Integer Generator specifically for integer.
Dice Roller
Choose Dice Roller when you need to roll one or more dice with custom side counts.; use Random Integer Generator specifically for integer.
Random List Picker
Choose Random List Picker when you need to pick one item from a pasted list.; use Random Integer Generator specifically for integer.
Random Order Generator
Choose Random Order Generator when you need to shuffle a pasted list into random order.; use Random Integer Generator specifically for integer.
Random String Generator
Choose Random String Generator when you need to create a cryptographically seeded random string.; use Random Integer Generator specifically for integer.
Limitations and privacy
- No seed or reproducibility control is exposed.
- The tool is not certified for gambling or regulated allocation.
- Floating-point and browser implementation details underlie the informal generator.
Inputs and generated results stay in this browser. No list or result is uploaded.
Frequently asked questions
Are both endpoints included?
Yes.
What happens to decimal limits?
Minimum rounds up and maximum rounds down.
Can I reproduce a result from a seed?
No. This page has no seed input.
Is it suitable for cryptographic values?
No. Use a purpose-built cryptographic generator.