Toolzent

Random Number Generator

Free random number generator: pick one or many random numbers between any min and max, with optional no-duplicates mode. True random, runs in your browser.

Updated 2026-06-09 · Free · No sign-up · Runs privately in your browser

Presets:

What is a random number generator?

A random number generator (RNG) is a tool that produces one or more unpredictable numbers within a range you choose. This one returns random whole numbers between a minimum and a maximum you set, with both ends included. You decide how many numbers to draw and whether they may repeat, click Generate, and the result appears instantly. Because every draw uses a cryptographically secure source of randomness, it behaves like a fair, unbiased pick from a hat — for a single number, a die roll, a set of lottery numbers, or any range you need. Every number is generated locally in your browser.

What does this tool do?

It turns a range and a count into random numbers. You set the min and max (the lowest and highest values that can come up), choose how many to generate, and optionally tick No duplicates. Click Generate and the tool draws your numbers — a single value when you ask for one, or a list when you ask for several. Two rules shape the output:

  • Inclusive range. Both the minimum and the maximum can be returned, along with every integer in between. A 1-to-6 range can yield 1, 2, 3, 4, 5 or 6.
  • Duplicates, optional. By default numbers may repeat, so drawing three from 1 to 6 could give 4, 4, 1. Tick No duplicates and every number is guaranteed unique, like dealing cards rather than rolling the same die again.

How does it work?

There is no single arithmetic formula — the method is uniform random sampling from your range. For each number, the tool asks the browser’s crypto.getRandomValues for a secure random value and maps it onto the integers from min to max so that every value is equally likely. This is a cryptographically secure source, not the predictable Math.random, which keeps the picks fair. The core steps are:

  1. Order the range. The tool reads your min and max. If the minimum is above the maximum, it swaps them, so the range is always low-to-high before anything is drawn.
  2. Draw with or without repeats. With duplicates allowed, it independently samples one uniform integer for each number you requested, so the same value can appear more than once. With No duplicates ticked, it instead shuffles the whole range and takes the first N, which guarantees all of them are distinct.
  3. Show the result. It displays the single number, or the full list, exactly as drawn.

A few terms worth pinning down:

  • Minimum (min): the smallest number that can be returned, inclusive — the min itself can come up.
  • Maximum (max): the largest number that can be returned, also inclusive.
  • How many (N): how many numbers to generate in one click. With No duplicates on, N cannot exceed the count of values in the range, which is max minus min plus 1.
  • No duplicates: a switch that forces every generated number to be unique.

Examples

Each example follows the exact method above: a uniform pick across the inclusive min-to-max range, with or without repeats. Because the draws are random, your specific numbers will differ each time — these show the rules and the range, not a fixed outcome.

Example 1 — one number from 1 to 100 (min = 1, max = 100, how many = 1). Leave duplicates as they are and click Generate. The tool returns a single whole number anywhere from 1 to 100 inclusive — it might show 73 one click and 8 the next. This is the classic “pick a number between 1 and 100”.

Example 2 — roll a die (min = 1, max = 6, how many = 1). Set the range to 1 through 6 and generate one number. The result is a value from 1 to 6, exactly like rolling a single six-sided die. Generate again for a fresh roll; each is independent.

Example 3 — lottery numbers, 6 from 1 to 49 (min = 1, max = 49, how many = 6, No duplicates ✓). Set the range to 1–49, ask for 6 numbers, and tick No duplicates. The tool shuffles all 49 values and takes the first six, returning six distinct lottery-style numbers such as 4, 17, 23, 31, 38, 45 — no number repeats. Without No duplicates, the same six draws could include a repeat like 17, 17, 5, ....

Example 4 — repeats allowed (min = 1, max = 6, how many = 3, No duplicates off). Ask for 3 numbers from 1 to 6 with No duplicates left off. Each is drawn independently, so a result like 4, 4, 1 is perfectly valid — the same value can appear more than once because nothing stops a repeat.

Range and settings reference

This table summarises how the key settings change what you get back. The “count of values” is simply max minus min plus 1, and it sets the most numbers you can draw when No duplicates is on.

SettingWhat it controlsExampleResult
min and maxThe inclusive rangemin 1, max 100Any value from 1 to 100
how many = 1A single numbermin 1, max 6One value, 1 to 6 (a die)
how many = 6, No duplicatesA unique setmin 1, max 49Six distinct numbers
Duplicates allowedRepeats permittedmin 1, max 6, three numberse.g. 4, 4, 1
min above maxRange is auto-swappedmin 100, max 1Same as min 1, max 100

The count of distinct values in a range is max − min + 1. So 1 to 49 holds 49 values and 0 to 9 holds 10 values; with No duplicates ticked, that count is the ceiling on how many numbers you can request.

Common uses

A random number generator is useful anywhere you need an unbiased pick:

  • Pick a number — settle “guess a number between 1 and 100” games or choose a winner by drawing a single value.
  • Simulate dice and spinners — set 1 to 6 for a die, 1 to 20 for a d20, or any range to stand in for a board-game randomiser.
  • Lottery and raffle numbers — generate a set of distinct numbers in a range, like 6 from 1 to 49, using No duplicates.
  • Random sampling — pick a row number, a seat, a test case or a participant ID at random for fair selection.

Tips and common mistakes

A few pointers to get accurate results and avoid surprises:

  • Keep No duplicates within the range size. You cannot draw more numbers than the range holds — six distinct values need at least six in the range (max − min + 1 must be at least how many).
  • Remember both ends are included. A 1-to-10 range can return 1 or 10, not just the numbers between. To exclude an endpoint, narrow the range yourself.
  • Use No duplicates for lottery and raffle draws. Without it, the same number can repeat, which is wrong for picks that must be unique.
  • Do not worry about min and max order. Entering the larger value first is fine — the tool swaps them, so min 100 and max 1 still works.
  • Generate again for a new result. Each click is independent (with duplicates allowed), so a previous high or low number does not make the next one more or less likely.

Limitations and notes

This tool generates uniform, whole-number results: every value in your range is equally likely, and (with duplicates allowed) one draw never influences the next. It works with integers only, so it does not return decimals or fractions — to get tenths, draw over a wider range and divide the result yourself. When No duplicates is on it shuffles the full range and takes the first N, which means how many cannot exceed the count of values in the range; ask for more and there simply are not enough distinct numbers to give. Results are not saved, so there is no history beyond the most recent draw on screen. The randomness comes from crypto.getRandomValues, which is unpredictable and well-suited to fair picks, but it is not a certified lottery or gambling instrument and should not be used where regulated, audited randomness is legally required. Everything runs privately in your browser: each number is generated locally with no network call, so nothing you do is uploaded, logged or stored, and the generator keeps working offline once the page has loaded.

For more quick decisions and random fun, pair this with the coin flip for a 50/50 yes-or-no, the dice roller for multi-sided rolls, and the magic 8 ball for a fortune-style answer, work out odds and shares with the percentage calculator, or browse the full fun and random tools collection.

Frequently asked questions

How do I generate a random number with this tool?+

Set the minimum and maximum, choose how many numbers you want, tick No duplicates if needed, then click Generate to get your result.

How do I pick one random number between 1 and 100?+

Set min to 1, max to 100, leave how many at 1, and click Generate to get a single value from 1 to 100 inclusive.

Are the minimum and maximum included in the range?+

Yes. Both ends are inclusive, so a 1 to 6 range can return 1, 6 or anything between them.

How do I generate lottery numbers like 6 from 1 to 49?+

Set min to 1, max to 49, how many to 6, and tick No duplicates to get six distinct lottery-style numbers.

Is the random number generator truly random and fair?+

Yes. It uses crypto.getRandomValues, a cryptographically secure source, to pick a uniform value in your range, so it is not predictable.

What does the No duplicates option do?+

It guarantees every number is unique, so how many you request cannot exceed the count of values in your min-to-max range.

What happens if I set the minimum higher than the maximum?+

The tool swaps them automatically, so entering min 100 and max 1 behaves the same as min 1 and max 100.

Can I generate negative random numbers?+

Yes. Use a negative minimum, for example min -10 and max 10, and the range spans negatives, zero and positives.