Generate
one number
Minimum value
Maximum value
Result

# Random Number Generator

By Rita Rain

This random number generator can produce pseudorandom numbers within a given range. You can pick numbers from -999,999,999,999,999 to 999,999,999,999,999, choose to generate decimals or integers, include or exclude the minimum and maximum values, disallow duplicates (random number generator with no repeats), and sort results from smallest to largest.

It can serve as both a single random number picker or a random number list generator. In the text below you'll find information on how to use this random sequence generator. It will also answers the questions: "what is RNG?", "what is the difference between pseudorandom number generators and true random number generators?" and "how do random number generators work?"

The numbers generated by this lucky number generator are pseudorandom - not truly random, but suitable for most purposes. However, be careful if you want to use it for encryption of top-secret government documents.

## Pick a number - how to use the random number generator

1. Single random number generator

If you want to generate one random number, choose a number which will be the lower limit (the minimum value), and then pick a number which will be the upper limit (the maximum value). To generate again, click the arrow below the "Result" field. (Make sure the "autosave" option is turned on by clicking the floppy disk icon next to the "Minimum value" and "Maximum value" fields).

By default, minimum and maximum values are included in the range of numbers generated. If you want to exclude them, click "advanced mode" (below the "Result" field), and you'll see the option to exclude one or both.

You can also generate decimals (up to two decimal places) - to do that change the "type of number(s)" setting.

2. Random number list generator

If you choose the "multiple numbers" option in the "Generate" field, input the quantity of numbers you need, and you'll see a sequence of random numbers.

In the advanced mode, you can also choose whether you want to allow duplicates in the random list and whether you want the results to be sorted (from smallest to largest).

If you want to generate numbers with the same settings again, click the "autosave" option to the right of variables you want to stay the same.

## Possible applications of the random number picker

Here are some ways you can use the random number generator. It may be helpful if you need:

• a random number list generator (random number table generator)

Choose "multiple numbers" option and input how many numbers you need (the list's length).

• a phone number generator

Choose the "multiple numbers," enter "7" into "how many" field (or another adequate number if you're not in the USA), set the minimum value to 0, and maximum value to 9. If 0 is the first number of the sequence, try again. The sequence will be a random phone number.

• a random 4 digit number generator

Set the minimum value to 1,000 and the maximum value to 9,999.

• a random number sequence generator

Works the same as a random list generator, see above.

• a random number generator no repeats

If you generate multiple numbers and want no repeats, go to advanced mode and set "no" in the "allow duplicates" section.

• to pick a random number between 69 and 666

Set the minimum value to 69 and maximum value to 666. RNGesus will forgive you. 😈

• to choose a random number between 1 and 4

Set the minimum value to 1 and the maximum value to 4.

• to generate 5 random numbers

Choose "multiple numbers" in the first field and enter "5" in the "how many" field.

• to pick a number from 1 to 10

Set the minimum value to 1 and maximum value to 10.

## What is RNG and how random number generators work

RNG (random number generator) is a device which produces a sequence of numbers that can't be predicted (each outcome has the same probability of being chosen).

Rolling dice is a hardware random number generating method. Each result has the same chance of appearing (`P = 1/6`). The same goes for flipping a coin - the probability of getting heads is equal to 50%, and so is the probability of getting tails (not including the possibility of it landing on its side). If you're inquisitive enough, you can try flipping a coin 100 times to check that, the longer you flip, the closer you get to an even distribution of outcomes. This phenomenon is known as the law of large numbers.

Although rolling dice is fun, using software is much quicker and more convenient. But how can computers produce random results if they're entirely deterministic? All that computers do is follow instructions, so how can anything they do be random?

## True random number generators and pseudorandom number generators

One solution is relying on some external input, which is truly random. For example, computers can use data from a piece of hardware that measures a random physical phenomenon like background radiation. These types of devices are called true random number generators.

Another way is to produce an outcome which seems unpredictable but in fact is the result of a strictly defined mathematical process. Software that does this is called a pseudorandom number generator. It takes in a "random enough" number (a seed), e.g. a part of the current time in the systems clock, and performs a function on it. The result is a pseudorandom number.

For many purposes (like gameplay or graphics), pseudorandom generators are enough, but true random number generators are sometimes needed for encryption.

This number generator is pseudorandom and uses the JavaScript function Math.random(). The algorithm which produces the result depends on the web browser you use. Nowadays, most of browsers use the xorshift128+ algorithm, which is based on bitwise operations (manipulation of data at the bit level).

Rita Rain