Skip to content
CalculatorBuddy

Random Number Generator

Generate random integers or decimals in your browser. Inclusive range, optional unique draws and sorting — a pseudo-random generator, not for cryptography.

One random integer between the limits (inclusive)

ExampleSample values — edit any field to see your result.

Inclusive. Integers or decimals; very large values are allowed.

Inclusive. Must be greater than or equal to the lower limit.

Draw one random integer, or many integers or decimals, uniformly between two inclusive limits. Optional unique draws and sorting. Generated on this device with a pseudo-random generator — not for cryptography.

Formula

A uniform integer on the closed interval [L, U] is

N = L + floor(random() × (U − L + 1))

random() is in [0, 1). Decimals use the same rule on a scaled integer grid with P digits after the decimal (multiply limits by 10^P, draw, then format back). Unique mode samples without replacement from that grid.

This is a pseudo-random generator (Math.random in your browser), not a cryptographic source. Do not use it for passwords, keys, or anything that must be unpredictable to an attacker.

Simple vs comprehensive

ModeWhat it draws
SimpleOne integer in [lower, upper], default 1–100
ComprehensiveN integers or decimals; duplicates yes/no; sort none / asc / desc; decimal precision up to 999 digits

Examples

One integer from 1 to 100

Simple mode, lower 1, upper 100. The result is a whole number, and both endpoints are possible.

Decimals at 50 places

Comprehensive mode, lower 0.2, upper 112.5, type Decimal, precision 50, generate 1. The value has fifty digits after the decimal and lies on that grid between 0.2 and 112.5.

Unique integers, sorted

Comprehensive mode, 1 to 5, generate 5, duplication No, sort Ascend. The only possible list is 1, 2, 3, 4, 5 — a full unique draw from a five-value pool, then sorted.

Frequently asked questions

Are these numbers truly random?
No. This is a pseudo-random number generator (PRNG). It uses the browser's Math.random, which is fine for raffles, samples, and games, but it is not cryptographic and must not be used for passwords, keys, or security tokens. True random numbers come from physical noise sources.
Is the range inclusive?
Yes. Both the lower and upper limits can appear in the result. The simple generator with limits 1 and 100 can return 1 and can return 100.
What does “allow duplication” mean?
Yes (the default) lets the same value appear more than once, like rolling a die. No draws without replacement, so every result is unique. Unique mode needs a large enough pool — five unique integers from 1 to 5 works; six does not.
How does decimal precision work?
Precision is the number of digits after the decimal point, from 1 to 999 (default 50). Limits are placed on that grid, then values are drawn uniformly. 0.2 to 112.5 at 2 digits means 0.20 through 112.50 inclusive.
Are numbers sent to a server?
No. Generation runs in your browser after the page loads. Click Generate again to draw a new set with the same limits. Nothing is stored or logged as a “chosen” number.

Related calculators