Random Number Generator – Integers, Decimals, Dice, Strings, Lottery
Random numbers free online: integers and decimals in any range, dice, strings, colors and lottery draws. Cryptographic randomness, no-repeat and sorting, all in your browser.
Runs on your device — nothing is uploaded
Adjust parameters to auto-generate
Generating...
Rolling dice...
Prize draws, sampling, making test data, rolling dice, giving the kids an indisputable verdict on "who washes the dishes first" — the need for random numbers is everyday and constant. But hidden inside the word "random" is a quality difference: many online tools make do with Math.random(), whose output can be predicted by working backwards — a real risk in prize draws or password-making.
This tool's entropy source is the browser's system-grade cryptographic randomness (crypto.getRandomValues), with de-biasing applied when values are drawn (see the next section). Six modes share the same randomness pipeline; change a parameter and the result recalculates, and a usable batch is already on the page the moment it opens.
How to use
Pick a mode
Six to choose from: Integer (any range), Decimal (chosen digit count), Dice (any face count and roll count), String (chosen character set), Color (HEX / RGB), Lottery (a number range or a custom list).
Set the parameters
Integer and Decimal support no-repeat and ascending / descending output; String takes your pick of digits / uppercase / lowercase / symbols / a custom set; Lottery picks K out of a range or a list.
Take the results
Results appear instantly and recalculate whenever a parameter changes; the history keeps the last few runs for comparison and review. One click copies the current batch.
The bias problem in random numbers
"Pick one of 6 faces with equal probability" sounds simple, but the implementation hides a famous pitfall — modulo bias: if you just take a 32-bit random number modulo 6, faces 0–5 are not equally likely, because 2 to the 32nd is not a multiple of 6, and the leftover remainder makes the earlier faces come up slightly more often.
This tool's answer is rejection sampling: compute the largest multiple of 6 that does not exceed 2³², discard and redraw whenever the random number lands outside that limit, and accept only values inside the uniform region before taking the modulo. Every result has exactly equal probability — each face of a six-sided die is precisely one sixth, and every name on a lottery list carries exactly the same weight.
| Stage | Approach |
|---|---|
| Entropy source | crypto.getRandomValues (CSPRNG, the same randomness the browser uses for keys) |
| Rounding | Rejection sampling removes bias; no more "the earlier numbers come up more often" |
| Fallback | Only very old browsers fall back to Math.random() — modern browsers never reach that branch |
"No repeat" is drawing semantics, not randomness semantics: with it on, each value appears once — "drawing balls from a bag without putting them back"; with it off, every roll is independent, and the same value can come up twice in a row. Choose per your meaning — a list draw usually wants "no repeat", a dice simulation must allow repeats.
Frequently asked questions
Can I use these numbers for a prize draw? Is it fair?
Yes. The cryptographic source plus rejection sampling guarantees every candidate equal probability — harder to rig than an offline draw, and the result is unpredictable. For list draws, turn on "no repeat" so nobody wins twice; the same goes for range draws (10 out of 1–100).
Can I make passwords with it?
It generates high-entropy random strings, but as a direct password it is not advisable: the String mode has no convenient "exclude confusable characters" switch, and the key to a good password is how you keep it, not the generator. If you must, enable digits + both cases + symbols and go past 16 characters; the symbol set already includes common punctuation.
Can the results be reproduced?
No — and they should not be; that is what random means. Reproducible "pseudo-randomness" (same seed, same sequence) belongs to seeded PRNG scenarios in programs, the opposite of what an online random tool aims at. The history is only there so you can look back at the last few results; it is not a seed.
Why do results regenerate automatically when I change a parameter?
By design: after a parameter changes the tool regenerates within 300 ms, avoiding the mismatch of "changed the range, still looking at old results". The history panel keeps earlier results for comparison whenever you need them.
How many can I generate at once?
Integer / Decimal / String batches can reach several hundred at a time; the same for dice rolls. The ceiling comes from scrolling the interface rather than a hard cap — ordinary use never bumps into it.
Does it upload anything?
No. Generation makes zero network requests and works offline — lists and results live only in browser memory.