Skip to content
ToolZone

Random Number Generator

Generate a random number within any range you specify, useful for games, raffles, sampling, or any need for an unbiased random pick.

Runs in your browser. Nothing you enter or upload leaves your device.

Uses your browser's cryptographically secure random generator, so every number in the range is equally likely.

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the Random Number Generator

Random Number Generator picks whole numbers between a minimum and maximum you set, both included. Ask for a single number to settle a decision, or up to 1000 at once for games, draws, sampling or test data, and copy the whole list in one click.

How it works

When you click Generate, the minimum and maximum are read as whole numbers. Each result is min plus a uniformly random offset drawn from the browser's cryptographic generator (crypto.getRandomValues), with rejection sampling so no value is favored. Both ends are included. With No duplicates on, each number appears at most once.

Normally each number is drawn independently, so the same value can come up more than once in a batch. With No duplicates on, every number in the batch is different. If the minimum is greater than the maximum, or a field is empty, a message explains what to fix. Decimal inputs are cut to their whole-number part, so 2.9 is treated as 2.

How to use

  1. 1

    Enter the smallest allowed number in Min.

  2. 2

    Enter the largest allowed number in Max.

  3. 3

    Set How many (1 to 1000), and tick No duplicates or Sort ascending if you need them.

  4. 4

    Click Generate, then use the copy button to copy the list.

Worked examples

Raffle winner

Picking one ticket from 250 sold.

Input
Min 1, Max 250, Count 1
Result
A single number such as 137

Practice problems

A teacher needs ten two-digit numbers.

Input
Min 10, Max 99, Count 10
Result
A list such as 42, 87, 15, 63, 42, 90, 28, 71, 56, 34

42 appears twice here, which is normal because each number is drawn independently.

Negative range

Random temperature offsets for a simulation.

Input
Min -5, Max 5, Count 5
Result
A list such as -3, 0, 4, -5, 2
Limitations
Only whole numbers are produced; decimals are not supported. With No duplicates on, How many can't exceed the number of values in the range. At most 1000 numbers can be generated at once, and the range can span at most 4,294,967,296 values.
Assumptions
Every whole number in the range should have an equal chance of being picked.
Privacy
Numbers are generated in your browser and nothing is sent to a server or saved.

Frequently asked questions

Can I generate multiple unique random numbers at once?+

Yes. Tick No duplicates and every number in the batch will be different, as long as the range holds enough numbers.

Is this suitable for cryptography or passwords?+

The numbers come from a cryptographically secure source, but for passwords a dedicated password generator is easier, since it mixes letters, digits and symbols.

Are the minimum and maximum included?+

Yes. Both ends of the range can be picked.

Can I use negative numbers?+

Yes. Any whole numbers work, as long as Min is not greater than Max.

Why don't I see a result?+

Read the message under the Generate button: Min must be no larger than Max, and with No duplicates the range must hold at least as many numbers as you asked for.

Related tools