Random Number Generator

Pick random numbers in any range.

Show details

Choose a minimum and maximum, decide how many numbers you need, and generate them instantly. Turn on 'no duplicates' when every number must be different — ideal for raffles, team draws, random sampling, or settling a decision fairly.

Loading calculator...

Generate a Random Number — The Quick Answer

Set the lowest and highest values you'll accept, choose how many numbers, and generate. The range is inclusive — both the minimum and maximum can come up — and every value in between is equally likely.

Shortcut

random integer = floor(random × (max − min + 1)) + min

Common ranges

UseRangeSetting
Coin flip0 to 1min 0, max 1
Dice roll1 to 6min 1, max 6
Percentage pick1 to 100min 1, max 100
Raffle (50 tickets, 3 winners)1 to 50count 3, no duplicates

This generator is 'pseudo-random' — it uses your browser's Math.random, which is excellent for everyday use but is not cryptographically secure. Don't use it for passwords, security tokens, or anything where the outcome must be unpredictable to an attacker or legally certified.

How It Works

1
Set the minimum and maximum — both ends are included in the possible results
2
Choose how many numbers you want (1 to 1000)
3
Tick 'no duplicates' if every number must be unique
4
Press Generate — the numbers appear instantly, and you can regenerate as many times as you like
5
Copy the results to share or record them

The Method

How a random integer in a range is produced

Formula

random integer = floor( random() × (max − min + 1) ) + min

Variables

random()

The source of randomness

The browser produces a random decimal between 0 (inclusive) and 1 (exclusive). Scaling it by the size of your range and adding the minimum maps it onto the whole numbers you asked for, each equally likely.

max − min + 1

Inclusive range size

The '+ 1' makes both endpoints possible. For 1 to 6 there are 6 outcomes (not 5), so a fair die needs max − min + 1 = 6 equally likely values.

no duplicates

Unique mode

When uniqueness is on, each drawn number is removed from the pool so it can't appear again — like drawing names from a hat. This requires at least as many possible values as numbers requested.

Note: The result is uniform: within your range no number is favoured over another. Patterns you might notice in a short run (a repeat, a streak) are normal — true randomness often looks less 'even' than people expect.

Worked Example

Picking 3 unique winners from 50 raffle tickets

1

Set the range

Tickets are numbered 1 to 50, so minimum 1 and maximum 50 — 50 equally likely outcomes.

2

Set how many and uniqueness

Three winners, so count 3 with 'no duplicates' on, so nobody can win twice.

3

Generate

The tool draws three different numbers from 1–50, for example 7, 23, and 41 — each ticket equally likely.

Reference Guide

unitvaluenote
Coin flip0 or 1min 0, max 1
Dice roll1 to 6min 1, max 6
Lottery-style1 to 49count 6, no duplicates
Pick a winner1 to 100count 1

Key Features

Any range — set any minimum and maximum, including negatives
Generate one number or up to 1000 at once
Optional 'no duplicates' mode for fair draws and sampling
Inclusive range, so both endpoints can appear
Copy results in one tap; regenerate instantly
Runs entirely in your browser — nothing you enter is sent anywhere

Last updated: October 5, 2026

Tufail Ahmed

Creators

Tufail Ahmed

Computer Scientist & Developer Tools Author

Reviewers

Khizar Nadim

Technical Reviewer

Quick Facts

CategoryMath & Statistics
Cost Free
Last updated2026-10-05

Privacy Guaranteed

Your data never leaves your browser. All calculations are 100% private.

Frequently Asked Questions

Is the minimum and maximum included in the result?

Yes — the range is inclusive at both ends. If you set 1 to 6, every value from 1 to 6 (including 1 and 6) is possible and equally likely, exactly like a fair six-sided die.

How do I pick several numbers with no repeats?

Turn on 'no duplicates' and set how many you need. The generator then draws without replacement, so each number appears at most once — perfect for raffles, team selection, or random sampling. You just need at least as many possible values as numbers requested.

Is this random number generator truly random?

It is pseudo-random: it uses your browser's built-in Math.random, which produces high-quality, uniformly distributed numbers that are indistinguishable from random for everyday purposes. It is not cryptographically secure, so it shouldn't be used for passwords, security keys, or outcomes that must be provably fair or tamper-proof.

Why did I get the same number twice (or a streak)?

With duplicates allowed, each pick is independent, so repeats and short streaks are completely normal — a run of random numbers often looks less evenly spread than people expect. If you need every result to differ, switch on 'no duplicates'.