THE TOOLKIT Free calculators & converters

Text, Random & Everyday

Random Number Generator

Random integers in any range (with or without duplicates), random decimals, and a dice roller. The randomness comes from your browser's cryptographic generator, crypto.getRandomValues — the numbers are created on your device and never sent anywhere.

What do you want to generate?

Your numbers

—
Generated—
Total—

How it works

Each number starts as a random 32-bit value drawn from crypto.getRandomValues, the cryptographic random number generator built into every modern browser — the same source browsers use for security-sensitive work. The value is then mapped into your range with rejection sampling: draws that fall in the leftover tail beyond the largest exact multiple of the range size are thrown away and redrawn, so every value in the range is exactly equally likely. (Simply taking the remainder of a random draw would quietly favor the low end of the range.) This is the same standard this site's password generator uses.

No duplicates mode keeps drawing until it has collected the requested count of distinct values — which means the count cannot exceed the size of the range itself. Asking for 10 unique numbers from 1 to 5 is impossible, and the generator says so instead of looping forever.

Decimals are generated on an exact grid: with 2 decimal places between 0 and 1, the possible results are 0.00, 0.01, …, 1.00 — 101 equally likely values, drawn with the same rejection-sampling method. Dice are the integer mode with a minimum of 1: a d20 is a uniform draw from 1 to 20.

Frequently asked questions

Is this random enough for a raffle or giveaway? Yes — the underlying source is a cryptographic generator, and the rejection sampling removes the range-mapping bias, so no number is favored. Nothing about the draw is recorded or sent anywhere, though, so for a formal drawing you may still want witnesses for the social side of fairness.

Why not just use a normal random function? Everyday random functions in code are usually predictable given enough outputs, and the shortcut math used to fit them into a range adds bias. crypto.getRandomValues is designed to be unpredictable, and rejection sampling keeps the odds exact.

What is the biggest range I can use? Integers can span up to about 4.3 billion values wide (the full 32-bit draw), and you can generate up to 1,000 numbers at a time — plenty for raffles, classroom picks, and tabletop dice pools.

More tools — Text, Random & Everyday

Every tool on this site runs in your browser. Nothing you type is sent anywhere, stored, or tracked.