Random Number Generator

Generate random whole numbers in any range, with an option for no repeats. The numbers come from the browser's cryptographic random source, not Math.random.

Updated

Password ToolsPopular● Free No upload Instant

Loading Random Number Generator…

Your browser is preparing the tool. It runs 100% locally.

Quick answer

Set a minimum, maximum and how many, and the tool returns random numbers across that inclusive range. Tick unique to draw without repeats. Many random tools use Math.random; this one uses the browser's cryptographically secure source, so every value is equally likely and nobody can predict the next one. That matters for raffles and draws. The numbers are generated on your device and never sent anywhere.

What the Random Number Generator does

The tool generates one or more random whole numbers between a minimum and a maximum you choose, with both ends included. You can ask for many at once and, if you like, require them all to be different, which means drawing without replacement.

Use it to pick a winner, roll a number, sample from a list by index or settle a decision with a number nobody could have guessed.

How it works

For each number, the tool takes a value from the browser's cryptographic random generator and maps it into your range, so every value from the minimum to the maximum has the same chance. Ordinary random functions can be predicted or replayed. This source can't.

With unique on, it draws from a pool of the possible values and removes each one once it's picked, so no number comes up twice. That only works if the range holds at least as many values as you ask for. Otherwise some numbers have to repeat.

Generation algorithm

  1. Read the range and count. Take the minimum, maximum and how many numbers you want.
  2. Draw secure randomness. Get a value from the browser's cryptographic random generator for each pick.
  3. Map into the range. Scale each value to a whole number between the minimum and maximum, inclusive.
  4. Apply unique if set. If unique is on, draw without replacement so no number repeats.

Random pick in a range

pick = min + ( secureRandom mod (max − min + 1) ) (both ends inclusive; unique mode draws without replacement)
Worked example
min 1, max 100, how many 5 → e.g. 7, 42, 73, 9, 88

Both min and max are included. Unique mode needs the range to hold at least as many values as you request, or some numbers will repeat.

Standards and references

  • Cryptographically secure randomness: The numbers come from the browser's CSPRNG (crypto.getRandomValues). Ordinary pseudo-random functions like Math.random are predictable, which rules them out where fairness or secrecy matters.
  • Uniform distribution: Each value in the range is equally likely. Over many picks the spread evens out, with no lean toward any part of the range.
  • Drawing without replacement: The unique option works like a raffle: each pick leaves the pool, so no number repeats, as long as the range is big enough for the count.

Accuracy and limits

The randomness is cryptographically secure, so nobody can predict the numbers and the draw is fair. Tools built on ordinary random functions can't promise that, because their output can be predicted or repeated.

Both ends of the range are included, so 1 to 100 can return 1 or 100. Off-by-one expectations cause the most surprises, so check the bounds before you draw.

Unique mode needs the range to hold at least as many distinct values as you ask for. Ask for more and repeats can't be avoided, so widen the range or lower the count.

It generates whole numbers only and spreads them evenly across the integers in your range. Decimals, fractions and weighted choices need a different setup.

Real-world uses

Picking a winner

Draw a fair random number for a raffle or giveaway.

Sampling by index

Choose random positions from a list.

Games and rolls

Generate dice-like or lottery-style numbers.

Unbiased decisions

Get an unpredictable number to settle a choice fairly.

When it fits, and when it doesn't

Good for

  • Fair, unpredictable random numbers
  • Raffles, draws and giveaways
  • Sampling items by index
  • Many numbers at once, optionally unique

Not the best choice for

  • Decimal or fractional numbers
  • Weighted or biased choices
  • Cryptographic keys or tokens (use a token tool)
  • Reproducible, seeded sequences

For a secret key or token, use a random token generator that outputs bytes in hex or Base64. Decimals or weighted picks need a custom calculation, since this tool spreads whole numbers evenly across a range.

Frequently asked questions

Is this random generator secure?
Yes. It uses the browser's cryptographically secure random source instead of an ordinary pseudo-random function, so the numbers can't be predicted and the draw is fair.
Are the minimum and maximum included?
Yes, both ends are inclusive. A range of 1 to 100 can return 1 or 100, so set the bounds to exactly the values you want to be possible.
What does the unique option do?
It draws without repeats, like pulling tickets from a hat. Every number in the result is different, provided the range holds at least as many values as you request.
What if I ask for more unique numbers than the range allows?
There aren't enough distinct values, so some numbers have to repeat. Widen the range or lower the count to keep them all unique.
Is this better than a Math.random tool?
For fairness, yes. Math.random can in principle be predicted. This tool uses a cryptographically secure source instead, which matters for raffles, draws and anything where nobody should be able to guess the outcome.
Can it generate decimals?
No. It draws whole numbers across your range. Fractional values need a different calculation, because this tool maps evenly onto integers.
How many numbers can I generate at once?
Many at a time, up to the tool's limit. Each is drawn independently, or without replacement if unique is on.
Can I use these numbers as a password or key?
For a secret, use a random token generator, which produces high-entropy bytes in hex or Base64. This tool picks numbers in a range and isn't built for generating secrets.
Is the result reproducible?
No. There's no seed, so the same settings give fresh numbers every time. Fair, unpredictable draws need exactly that.
Does it favour any part of the range?
No. The distribution is uniform, so every value between the minimum and maximum is equally likely, with no bias over many draws.
Is anything uploaded?
No. Your browser generates the numbers, and the range and results stay on your device.
Can I get negative numbers?
Yes, if you set a negative minimum. The range is whatever you specify, so a minimum below zero produces negative results within the bounds.

References

Each number is drawn from crypto.getRandomValues, the browser's cryptographic source, and spread evenly over an inclusive range. Math.random is not used anywhere in it.

PopularHot

Password Generator

Generate a strong random password with your browser's cryptographic generator. Set the length and character mix, then copy it. Nothing is sent anywhere.

PasswordOpen Tool
Popular

Password Strength Checker

Check how strong a password is and get an entropy estimate in bits, plus tips on what to add. The check runs on your device and sends nothing you type.

PasswordOpen Tool
PopularHot

Image Compressor

Compress an image to JPEG with a quality slider and watch the file size drop as you drag, in your browser.

ImageOpen Tool
PopularHot

Merge PDF

Combine several PDFs into one file in the order you choose, without leaving your browser.

PDFOpen Tool
PopularHot

Word Counter

Count words, characters, sentences and paragraphs as you type, with reading and speaking time alongside.

TextOpen Tool
PopularHot

Meta Tag Generator

Fill in your page title, description, keywords and author, and the tool writes a block of HTML head meta tags you can paste, with the title, description, viewport and robots tags included. The block updates as you type.

SEOOpen Tool

Back to the Random Number Generator

Generate as many as you need at the top of the page. It runs on this device and needs no account.