Random Number Generator

Choose a minimum, a maximum and how many integers to draw. The range is inclusive on both ends. You can allow repeats, or require unique values (the count cannot then exceed the size of the range). Draws use the browser’s Math.random() function. That is fine for a classroom raffle, a game, or a sample set. It is not a cryptographic source and must not be used for passwords, lottery-grade draws, or security tokens.

By Rashid MehmoodLast updated and reviewed Free, no sign-up

Random number generator

–

How to use the random number generator – inclusive range

  1. Set the range. Enter the minimum and the maximum. Both ends are included, so 1 to 6 can produce 1 and 6.
  2. Set the count. Choose how many numbers to draw, from 1 to 200.
  3. Allow repeats or require unique values. Unique draws cannot ask for more numbers than the range contains.
  4. Generate. A new list is drawn each time. Refresh or click again for another draw — previous draws are not stored as a seed you can replay.
Embed this calculator

Paste this iframe on your own site. The embed view already includes a visible “Calculator by CalcTen” credit, which must stay visible. See the developers page for the conditions.

How a draw is made

Each integer in the inclusive range has an equal chance of being selected on a given draw. When repeats are allowed, every position in the list is an independent draw. When unique values are required, a drawn integer is removed from the pool before the next one is taken, so the list is a simple sample without replacement.

Range size = max − min + 1 (inclusive integers)
Unique draws require count ≤ range size

Worked examples

One integer from 1 to 6. This is a standard die. Any result from 1 through 6 is valid. The page will not show the same number every time; if it did, that would be a bug, not a feature.

Five unique integers from 1 to 10. The list might be 3, 9, 1, 7, 4 — the order is part of the draw. It will never contain a repeated value, and it will never contain 0 or 11.

A classroom raffle. If 28 students are numbered 1 to 28 and you want three unique winners, set min 1, max 28, count 3, unique. Do not use this method to generate passwords for those students.

Use cases and common mistakes

Use the generator for a game, a raffle, a random sample, or a prompt in class. Common mistakes include treating the range as exclusive of the ends, asking for more unique values than the range holds, and using the output as a security secret. For calculations rather than draws, use the basic calculator or the scientific calculator.

Limitations

The source is Math.random(), which is not cryptographic. There is no exported seed, no official audit of the generator, and a cap of 200 numbers per draw. If you need a statistically specified or legally defensible draw, use a method designed for that purpose.

Frequently asked questions

Is 1 to 6 inclusive?

Yes. A six-sided die should be able to show both 1 and 6. The same rule applies to any integer range you type.

Can I generate unique numbers?

Yes. Switch to unique (no repeats). If you ask for 10 unique numbers from 1 to 5, the request is rejected because the range only has five values.

Is this random enough for a password or a lottery?

No. Math.random() is a general-purpose pseudo-random generator. It is not a cryptographic API, it is not a hardware entropy source, and it is not suitable for passwords, security tokens, or official prize draws.

Can I get the same sequence again?

Not from a saved seed — this page does not expose a seed. Each click is a new draw. If you need a repeatable sequence, you need a different, seeded tool.

What is the largest list I can draw?

Up to 200 numbers in one go, to keep the page readable. For unique draws the cap is also the size of the range.

Can the minimum be larger than the maximum?

No. Swap the two values first. Decimal endpoints are not used: the generator works on integers.

Do you use the Web Crypto API?

No. The implementation is Math.random(), and the page says so, so the limitation is visible rather than implied.

Sources and references

About this calculator

Written and maintained by Rashid Mehmood, founder of CalcTen. The formulas are unit-tested against hand-worked examples, and the content is reviewed whenever product sizes or guidance change. Last updated and reviewed 15 November 2026. See our editorial policy. If you spot a mistake, report it.

Results are calculated from the numbers you enter and shown with the working. Rounding is applied only when displaying results. Grade and GPA scales, and weighting rules, vary by school, so confirm with your institution. Read the disclaimer.

Calculator by CalcTen — free online calculators.