Everyday tool

Random Number Generator

Set a minimum and maximum, then generate a random number locally.

Runs in your browser. No upload.
—

Uses your browser’s secure random source.

About this tool

Random Number Generator made simple.

The generator uses your browser’s secure random source and never sends your range or result anywhere.

Guide

Using Random Number Generator

The Random Number Generator picks numbers between a minimum and a maximum that you choose. You can ask for one number or a long list, whole numbers or decimals, with repeats or without. Whole-number picks include both ends of your range, so 1 to 6 can give a 1 or a 6. The numbers come from the secure random source built into your browser, and your range is never sent anywhere. It suits games, draws, sampling and quick decisions. Do not use it for passwords or security keys, which need a tool made for that job.

How to use it

  1. Type a Minimum and a Maximum. The page starts with 1 and 100. A button sets that range again.
  2. Type how many numbers you want in How many numbers? The page accepts a whole number from 1 to 100,000.
  3. Keep Whole number only ticked for integers. Untick it to get decimals between the two values.
  4. Tick No repeats if each number must appear at most once. This works only with whole numbers.
  5. Press Generate number. The results appear one per line. Press again for a fresh set.
  6. Press Copy result to copy the list, or Clear to empty the boxes and the result.

Worked examples

Rolling one six-sided die

You enter
Min
1
Max
6
Count
1
Whole only
yes
You get
Result
one whole number from 1 to 6

Each press gives a single number, and every value from 1 to 6 has the same chance. Nothing outside the range can appear.

Run through the tool’s own code.

Five different numbers from 1 to 5

You enter
Min
1
Max
5
Count
5
Whole only
yes
No repeats
yes
You get
Result
the numbers 1, 2, 3, 4 and 5 in a random order

When the count equals the size of the range and repeats are off, every number is used once. The only thing that changes is the order, like shuffling five cards.

Run through the tool’s own code.

Asking for more different numbers than exist

You enter
Min
1
Max
5
Count
6
Whole only
yes
No repeats
yes
You get
Message
There are not enough different numbers in this range.

Only five whole numbers lie between 1 and 5, so six different ones are impossible. Widen the range or lower the count.

Run through the tool’s own code.

Three decimals between 0 and 1

You enter
Min
0
Max
1
Count
3
Whole only
no
You get
Result
three numbers like 0.42240613459725485, each from 0 up to but not including 1

Decimals are not rounded, so they come out with many digits. Round them yourself if you want two or three places.

Run through the tool’s own code.

Bounds that are not whole numbers

You enter
Min
1.2
Max
5.8
Count
5
Whole only
yes
You get
Result
five whole numbers, each between 2 and 5

The tool moves the minimum up to 2 and the maximum down to 5 before picking. The values 1 and 6 are outside your range, so they never appear.

Run through the tool’s own code.

A minimum that is larger than the maximum

You enter
Min
10
Max
1
Count
1
You get
Message
Enter a valid minimum and maximum.

The tool does not swap the two values for you. Put the smaller number in Minimum and the larger one in Maximum.

Run through the tool’s own code.

When it helps

  • Roll a die or pick a number for a board game or a classroom game.
  • Draw winning numbers for a small giveaway among numbered entries.
  • Choose a random sample of row numbers from a list or a spreadsheet.
  • Pick lottery-style numbers for fun without repeats.
  • Settle a tie or make a quick choice between several options.
  • Create test numbers for a spreadsheet or a small program.

Limits to keep in mind

  • The count must be a whole number from 1 to 100,000. The box itself may suggest a smaller limit, but the tool accepts up to 100,000.
  • Minimum must not be larger than Maximum, and both must be filled in. Otherwise you see an error and a dash.
  • No repeats needs Whole number only. With decimals the box is turned off and repeats are possible, although equal decimals are very unlikely.
  • With No repeats, the count cannot be larger than the number of whole numbers in your range.
  • Decimals come out unrounded with many digits, and the maximum itself is never reached when you pick decimals.
  • Very wide ranges are limited. Whole-number bounds outside the safe integer range of about 9 quadrillion are rejected.
  • Do not use the numbers as passwords, security tokens or in places where an official draw is required.

Tips

  • Press the 1 to 100 button if you changed the boxes and want the default range back.
  • To pick a winner from a list, number the entries from 1 and use that range with a count of 1.
  • To shuffle a list of N items, set the range to 1 to N, the count to N and tick No repeats.
  • For a coin flip, use the range 1 to 2 and decide ahead of time which number means heads.
  • Generate more numbers than you need if you plan to skip some, and use them in order.

Sources

Common questions

About Random Number Generator.

How do I generate a random number from 1 to 100?

Leave Minimum at 1 and Maximum at 100, keep Whole number only ticked, set the count to 1 and press Generate number. The 1 to 100 button restores these settings if you changed them.

Can I get numbers without repeats?

Yes. Tick Whole number only and No repeats. Every number in the list is different, and the count cannot exceed how many whole numbers fit between your minimum and maximum.

Are the minimum and maximum included?

For whole numbers, yes. A range of 1 to 6 can return 1 and can return 6. For decimals the minimum can appear, but the maximum itself is not reached.

Can it make negative numbers?

Yes. Type a negative minimum, such as -10, and a maximum such as 10. The results can be negative, zero or positive. Negative ranges like -10 to -5 also work.

How do I get decimal numbers?

Untick Whole number only. The tool then returns decimals between your two values. They are not rounded, so copy them into a spreadsheet and round there if you only need a few places.

Is the result really random?

It uses the secure random source your browser provides, which is meant to be cryptographically strong. Whole-number picks are corrected so each value has the same chance. No pattern is stored or reused.

Why does the tool say Enter a whole number?

The How many numbers? box was empty, below 1, above 100,000 or not a whole number. Type a whole number in that range and try again.

What happens if I type a decimal as the minimum while Whole number only is on?

The tool rounds the minimum up and the maximum down to whole numbers before it picks. A range of 1.2 to 5.8 therefore gives numbers from 2 to 5.

Is my range or result sent anywhere?

No. The numbers are made on your device in your browser, and the range and result are not uploaded. If you press Copy result, the text goes only to your own clipboard.

Can I use it for passwords or an official lottery?

No. A password needs a tool built for secrets, and an official draw has its own rules and witnesses. This page is fine for games, quick picks and tests, where a fair result is enough.

Why do I see the same number twice in a row?

With repeats allowed, each pick is independent, so the same value can come twice, even in a row. That is a sign of true randomness. Tick No repeats if you need all values different.

Can I generate random numbers without repeats?

Yes. Select whole numbers and No repeats. The requested count must not exceed the number of integers in your range.