Skip to content
Menu
Theme

Random Number Generator

Pick random numbers in any range, with or without repeats, with decimals, or as network ports. Free, and it runs entirely in your browser.

MathRuns in your browser
What to generate
Random number
 

What is a random number generator?

A random number generator picks numbers by chance from a range you choose. Set a minimum and a maximum, say how many numbers you want, and the tool draws them for you. Every number in the range has the same chance of coming up.

It is handy whenever a fair choice matters more than your own pick. You can draw a raffle winner from ticket numbers 1 to 500, choose which student answers next, roll a die by setting the range to 1 to 6, or pick lottery style numbers for an office pool. Teachers use it to make practice sums. Testers use it to fill a form with sample values.

A few options shape the draw:

  • Allow repeats decides whether the same number can come up twice. Turn it off for raffles and seat draws, where each number should appear only once. The tool then tells you if you asked for more numbers than the range holds.
  • Decimals lets you draw numbers with up to three places after the point, such as 4.72, instead of whole numbers only.
  • Sort the results puts the numbers in order from smallest to largest, which makes a long list easier to check.

There is also a network ports mode for people who set up servers and apps. It picks port numbers from the well-known range (1 to 1023), the registered range (1024 to 49151), the dynamic range (49152 to 65535) or a range of your own. When a port has a common use, such as 443 for HTTPS, the tool names it next to the number.

The numbers come from your browser’s built-in random source, and the draw happens on your own device. Nothing is sent anywhere and nothing is kept when you close the page.

How to use the random number generator

  1. Choose numbers or network ports at the top.
  2. Type the smallest and largest number you want in the minimum and maximum boxes. In ports mode, pick a range instead.
  3. Type how many numbers you want, from 1 up to 10,000.
  4. Pick how many decimal places you want, and tick or untick the repeat and sort options.
  5. Press “Generate”. One number shows up large on its own. Several numbers appear in a list that you can copy with one click.
  6. Press “Generate” again for a fresh draw.

FAQ

Are the numbers truly random?

They come from the random source built into your browser, which is designed for security work such as making passwords. That is more than fair enough for raffles, games and classroom use. Each number in the range has an equal chance.

Is the maximum included in the draw?

Yes. Both ends count. A range of 1 to 6 can give 1, 6 or anything in between, just like a die.

Why do I get an error when repeats are off?

Without repeats, every number can come up only once. If you ask for 20 numbers between 1 and 10, there are not enough to go round. Lower the count, widen the range or allow repeats.

Can I use it to pick a winner for a giveaway?

Yes. Number your entries, set the range to match, set the count to the number of winners and turn repeats off. If you need proof for others, take a screenshot of the result right after you press “Generate”.

What is a network port?

A port is a number from 1 to 65535 that tells a computer which program should get a piece of network traffic. Web servers usually listen on 80 or 443. The dynamic range is a safe place to pick a port for your own test app.

Is anything I generate stored or sent anywhere?

No. The numbers are drawn inside the page on your device. Nothing is uploaded and nothing is saved after you close the tab.

Related tools