Random Number Generator
Generate random numbers within any range — integers or decimals, single or multiple.
Did this tool work for you?
How to use this calculator
- 1
Set the minimum and maximum values.
- 2
Choose how many numbers to generate.
- 3
Select integer or decimal output.
- 4
Click Calculate for a new set of random numbers.
Frequently asked questions
Is the generator truly random?
It uses Math.random, a pseudo-random generator built into the browser. That is fine for games, sampling for classroom exercises or choosing an order, but it is not a cryptographic source, so do not use it for passwords, security tokens or anything where the result must be unpredictable or auditable.
Are the minimum and maximum included?
For integers, yes: both ends are possible, and every whole number between ceil(min) and floor(max) is equally likely. For example, 1 to 6 can return 1 and 6. For decimals the value is drawn between min and max and then rounded to two places, so the maximum can occasionally appear after rounding.
What if I enter decimal bounds with Integer selected?
The range shrinks to the whole numbers inside it. With 1.2 to 1.8 there is none, so the tool returns "There is no whole number between 1.2 and 1.8" rather than guessing.
What does the unique option do?
Choosing "No (unique numbers only)" draws without replacement, but only for integers. The tool shuffles every whole number in the range and takes the first ones, or, for ranges above one million values, redraws on collision. Asking for more unique numbers than the range holds, such as 5 numbers from 1 to 3, gives an error saying only 3 are available. Decimals ignore this setting.
What happens if I leave a field blank or set the maximum to 0?
Clearing a box counts as 0, and zero is accepted as a real value rather than reverting to 1 or 100, so a range of -10 to 0 works as typed. A maximum of 0 with the starting minimum of 1 returns the error “Minimum must not be greater than maximum”. Number fields are read with parseFloat, which means 12abc is read as 12 and 1e3 as 1000.
How many numbers can I generate at once?
Between 1 and 100; larger counts are clamped to 100, and anything not a number counts as 1. When you ask for more than one, the tool also shows the sum, the lowest value drawn and the highest.
Can it handle huge numbers?
Integers are ordinary JavaScript numbers, which are exact only up to 9,007,199,254,740,991. Ranges beyond that lose precision. For dice and everyday ranges this never matters.
Random integers and decimals, with explicit range rules
Inclusive integer ranges
The most common mistake with random number tools is an off-by-one at the top of the range. Here an integer draw takes the lowest whole number in your range, adds a random offset, and covers every integer up to and including the highest. So 1 to 6 behaves like a die, 0 to 9 yields a digit, and 5 to 5 always returns 5. Setting the minimum equal to the maximum is allowed and simply repeats the number.
| Setting | Behaviour |
|---|---|
| Integer | Whole numbers from ceil(min) to floor(max), both ends possible |
| Decimal (2 places) | Uniform between min and max, rounded to two decimals |
| Duplicates allowed (Yes) | Each number drawn independently, so repeats are possible |
| Unique only (No) | Integers only: draws without replacement, error if count exceeds the range |
| How many | 1 to 100; more than one adds sum, lowest and highest |
Worked example: a range ending at zero
A range of -10 to 0 for three integers is valid and returns whole numbers between -10 and 0 inclusive. One run returned -1, -9 and -8, with a sum of -18, a lowest value of -9 and a highest of -1. Your numbers will differ, because every click draws fresh ones. Equal bounds are just as predictable: 5 to 5 with two numbers returned 5 and 5 with a sum of 10, which is useful for confirming how the summary lines work.
Worked example: errors you can trigger
Asking for 5 unique integers between 1 and 3 returns the message "Cannot generate 5 unique integers in range 1–3 (only 3 available)", since nothing can be drawn without repeats. An integer range of 1.2 to 1.8 returns "There is no whole number between 1.2 and 1.8". Reversed bounds, such as a minimum of 10 and a maximum of 1, return "Minimum must not be greater than maximum". These checks run before any random number is drawn.
Decimals and rounding
In decimal mode the tool draws a real number across the range and rounds to two places. A draw from 1 to 10 might show 5.26, 1.9 or 7.54; trailing zeros are dropped in the display, so 1.90 appears as 1.9. The sum line for decimals is shown to two decimal places. Because rounding happens after the draw, values near the maximum can round up to it. If you need more precision or a specific distribution, such as a normal curve, this tool does not provide it.
Where it fits and where it does not
The generator suits picking a raffle position, rolling a custom die, choosing a sample size or generating test data. It stores nothing and keeps no history, so ten clicks are ten unrelated draws. It does not weight outcomes, and it cannot prove fairness to others. For lotteries with legal requirements, or any security use, a certified or cryptographic source is the right tool.
Learn more from an authoritative source:
WikipediaDice Roller
Roll any number of dice with custom sides — D4, D6, D8, D10, D12, D20, D100, or custom.
Coin Flip
Flip a virtual coin — heads or tails. Flip multiple times and see statistics.
Magic 8 Ball
Ask the Magic 8 Ball a yes/no question and receive its mystical answer.
Random Color Generator
Generate random colors in HEX, RGB, and HSL formats. Generate a single color or a set of 5 random colors at once for design inspiration.
Color Palette Generator
Generate a harmonious color palette from any base hex color. Choose from complementary, analogous, triadic, or monochromatic schemes.
Username Generator
Generate unique, creative usernames from your name or keyword. Get 10 username suggestions with different styles — social media, gaming, professional.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →