Generators
Random Number Generator
Generate random integers from a custom inclusive range.
Random result
Generate to create a fresh result.
No result yet
About This Tool
A random number generator is useful for sampling test cases, choosing practice problems, assigning informal identifiers, creating randomized examples, and making ordinary low-stakes selections from a numeric range. Set inclusive minimum and maximum integers, choose how many values you need, and optionally require every generated value to be unique. The generator uses the browser's cryptographic random-number source rather than Math.random and runs locally without a random-number API.
How To Use It
- Enter the minimum and maximum whole numbers. Both endpoints are eligible results.
- Choose a result count from 1 to 1,000.
- Enable No duplicates when each integer may appear at most once in the same generated batch. The requested count then cannot exceed the number of integers in the range.
- Select Generate numbers to create a fresh independent batch, then copy the newline-separated result if needed.
Examples
One number from 1 to 100
Set minimum 1, maximum 100, and count 1. Every integer from 1 through 100 is an eligible result, including both 1 and 100.
Five unique question numbers
For questions numbered 1 through 30, set the range to 1–30, count to 5, and enable No duplicates. Five distinct question numbers are sampled without replacement.
Negative and positive test values
A range such as -10 through 10 can generate negative values, zero, and positive values. This is useful for creating ordinary integer test inputs around zero.
Duplicates allowed
With a range of 1–6 and count 10, leave No duplicates off. The same integer may legitimately appear several times because each draw is independent.
Useful Notes
Inclusive integer ranges
The range includes both minimum and maximum. A range from 5 to 5 therefore contains one possible integer and can still produce repeated 5s when duplicates are allowed. Inputs must be JavaScript safe integers so the tool does not silently round values that cannot be represented exactly.
Cryptographic browser randomness
The tool obtains unsigned 32-bit values from crypto.getRandomValues. This is a stronger randomness source than Math.random for general browser utilities, although this page is not a cryptographic key generator or audited random-draw system.
Avoiding modulo bias
A 32-bit random value cannot always be divided evenly among an arbitrary number of possible integers. The generator uses rejection sampling: values in the uneven remainder region are discarded before applying modulo, so each index in the requested range receives the same mapping share.
Unique versus repeated results
When No duplicates is disabled, each draw is independent and repeated values are possible. When enabled, already-selected integers are rejected until the requested number of distinct values has been collected. This is sampling without replacement within one generated batch.
Practical limits
The inclusive range is limited to at most 4,294,967,296 integers because the unbiased index source is one unsigned 32-bit value. A batch is limited to 1,000 results to keep browser work and output manageable. Very dense unique sampling near the maximum range size is not a goal of this lightweight utility.
Scope and privacy
Generation happens in the browser and does not send the selected range or generated numbers to an API. The tool is intended for ordinary low-stakes uses such as examples, testing, study, and informal selection—not lotteries, gambling, regulated drawings, security keys, passwords, elections, or other audited high-stakes randomness.
FAQ
Are the minimum and maximum included?
Yes. The interval is inclusive, so both endpoint integers can be generated.
Can I generate numbers without duplicates?
Yes. Enable No duplicates. The number requested must not be greater than the number of distinct integers in the inclusive range.
Why can repeated numbers appear?
When No duplicates is off, each draw is independent. Repeats are a normal outcome of random sampling and do not by themselves indicate a problem.
Why not use Math.random?
This tool uses crypto.getRandomValues for a stronger browser randomness source and rejection sampling to avoid modulo bias when mapping values into the selected range.
Can I use this for a lottery or cryptographic key?
No. It is an ordinary browser utility, not a certified lottery system, regulated drawing platform, or cryptographic key generator. Use purpose-built audited systems for those tasks.
Related Tools
List Randomizer & Random Picker
Shuffle lists or pick random entries locally in your browser.
UUID Generator
PopularCreate secure random UUID v4 values.
Password Generator
Generate configurable random passwords locally in your browser.
Number Base Converter
Convert integers between binary, octal, decimal, and hexadecimal.