Random Number Generator
Generate random integers in any range, random decimal numbers with the decimal places you choose, or random fractions, one at a time or as a list.
Generate random integers in any range, random decimal numbers with the decimal places you choose, or random fractions, one at a time or as a list.
crypto.getRandomValues source with unbiased rejection samplingPick a number type, set the minimum and maximum, enter how many numbers you need and press Generate. Leave No duplicates ticked when every value must be unique, such as ticket numbers or seat assignments; untick it when repeats are fine, such as simulated dice rolls. The quick presets load common setups in one click.
Integer mode returns whole numbers. Both ends of the range are included, so 1 to 6 behaves like a die and 0 to 99,999 gives a random five-digit-or-less integer for sample IDs and test data. Negative ranges such as -50 to 50 work too.
To get a single random integer between two numbers, set the minimum and maximum and set How many to 1. Every value in the range has exactly the same chance, because the generator discards the few raw values that would otherwise bias the result towards the low end.
Switch the type to Decimal and choose the decimal places. Between 0 and 100 with four places you get values like 57.1942, handy for sample measurements, prices, sensor readings and probability exercises.
Fraction mode builds a numerator from your numerator range over a denominator from 1 to the largest denominator you set, for example 29/23. Leave fractions unsimplified so students can practise reducing them and converting improper fractions, or tick Simplify fractions and Proper fractions only for tidy values below 1.
| Setting | Example output | Typical use |
|---|---|---|
| Integer, 1 to 100, 5 numbers, no duplicates | 17, 83, 4, 62, 39 | Classroom picks, giveaways |
| Integer, 0 to 99,999 | 48213 | Sample IDs, test data |
| Decimal, 0 to 100, 4 places | 57.1942 | Mock measurements |
| Fraction, numerator 0 to 99, denominator up to 99 | 29/23 | Fraction practice |
| Integer, 1 to 49, 6 numbers, sorted | 3, 11, 19, 27, 40, 46 | Lottery-style picks |
Set the number base to Binary to see each integer in base 2. The Binary (8-bit) preset draws 0 to 255 and pads to 8 digits, giving values such as 01101001; set the range to 0 to 65,535 and pad to 16 for 16-bit values, or 0 to 1 for a stream of random bits. Tick the prefix option for 0b01101001, the literal format used in JavaScript, Python and C.
Choose Hexadecimal for base 16. The Hex (32-bit) preset draws 0 to 4,294,967,295 and pads to 8 digits, for values such as 9F3A07C2. Pad to 2 for random bytes, 4 for 16-bit words or 6 for colour-like codes, and switch uppercase or the 0x prefix on or off. Octal (base 8) is there too. Minimum and maximum are always entered in ordinary decimal.
| Setting | Example output | Typical use |
|---|---|---|
| Binary, 0 to 255, pad 8 | 01101001 | Bit masks, binary-conversion practice |
| Hex, 0 to 4,294,967,295, pad 8 | 9F3A07C2 | Test IDs, memory addresses, checksums |
| Hex, 0 to 255, pad 2, prefix | 0x3C | Random byte values |
| Octal, 0 to 511, pad 3 | 644 | Unix file-permission practice |
Teachers call on students fairly, raffle organisers draw winning tickets, developers seed test data and pick random delays, researchers sample records, and friends settle a tie. For regulated lotteries or cryptographic keys, use a dedicated certified system.
Leave the type on Integer, set Minimum to 1 and Maximum to 100, set How many to 1 and press Generate. Both 1 and 100 can be drawn.
Yes. Keep No duplicates ticked. The tool will not return more unique numbers than the range contains, so 1 to 10 gives at most 10 unique integers.
Choose Decimal as the number type and set the decimal places, from 0 to 10. For example 0 to 100 with 4 places gives values such as 57.1942.
Yes. Choose Fraction, set the numerator range and the largest denominator. You can keep fractions unsimplified for practice, simplify them, or limit results to proper fractions below 1.
Up to 10,000 per click. Lists can be sorted and separated by new lines, commas or spaces, and Copy puts the whole list on your clipboard.
They come from the browser crypto.getRandomValues API with rejection sampling, so every value in the range is equally likely. That is fine for games, draws and test data; use a certified system for regulated lotteries.
Random 4-Digit NumberRandom Hex StringPrime Number GeneratorRoll a DiceFlip a CoinRandom Name PickerRandom Letter GeneratorUUID Generator