Random number from 1 to 100. Online random number generator

submitted online generator random numbers works on the basis of a programmatic pseudo-random number generator built into JavaScript with a uniform distribution. Integers are generated. By default, 10 random numbers are displayed in the range 100...999, the numbers are separated by spaces.

Basic settings of the random number generator:

  • Amount of numbers
  • Number range
  • Separator type
  • On / off the function of removing repetitions (doubles of numbers)

The total number is formally limited to 1000, the maximum number is 1 billion. Separator options: space, comma, semicolon.

Now you know exactly where and how to get a free sequence of random numbers in a given range on the Internet.

Random Number Generator Use Cases

Random number generator (RNG on JS with uniform distribution) will be useful for SMM-specialists and owners of groups and communities in in social networks Instagram, Facebook, Vkontakte, Odnoklassniki to determine the winners of lotteries, contests and prize draws.

The random number generator allows you to draw prizes among an arbitrary number of participants with a given number of winners. Contests can be held without reposts and comments - you yourself set the number of participants and the interval for generating random numbers. You can get a set of random numbers online and for free on this site, and you do not need to install any application on your smartphone or program on your computer.

Also, an online random number generator can be used to simulate the tossing of a coin or dice. But by the way, we have separate specialized services for these cases.

Have you ever wondered how Math.random() works? What is a random number and how is it obtained? And imagine a question at an interview - write your random number generator in a couple of lines of code. And so, what is it, an accident and is it possible to predict it?

I am very fascinated by various IT puzzles and puzzles, and the random number generator is one of such puzzles. Usually in my telegram channel I sort out all sorts of puzzles and various tasks from interviews. The task about the random number generator has gained great popularity and I wanted to perpetuate it in the depths of one of the authoritative sources of information - that is, here on Habré.

This material will be useful to all those front-end developers and Node.js developers who are at the forefront of technology and want to get into the blockchain project / startup, where even front-end developers are asked questions about security and cryptography, at least at a basic level.

Pseudo random number generator and random number generator

In order to get something random, we need a source of entropy, a source of some kind of chaos from which we will use to generate randomness.

This source is used to accumulate entropy, followed by obtaining from it the initial value (initial value, seed), which is necessary for random number generators (RNG) to generate random numbers.

The Pseudo-Random Number Generator uses a single seed, hence its pseudo-randomness, while the Random Number Generator always generates a random number, starting with a high-quality random value that is taken from various sources entropy.

Entropy - is a measure of disorder. Information entropy is a measure of the uncertainty or unpredictability of information.
It turns out that in order to create a pseudo-random sequence, we need an algorithm that will generate some sequence based on a certain formula. But such a sequence can be predicted. However, let's imagine how we could write our own random number generator if we didn't have Math.random()

PRNG has some algorithm that can be reproduced.
RNG - is getting numbers completely from any noise, the ability to calculate which tends to zero. At the same time, the RNG has certain algorithms for leveling the distribution.

Inventing our own PRNG algorithm

Pseudo-random number generator (PRNG) is an algorithm that generates a sequence of numbers, the elements of which are almost independent of each other and obey a given distribution (usually uniform).
We can take a sequence of some numbers and take the modulus of the number from them. The simplest example that comes to mind. We need to think about what sequence to take and the module from what. If just directly from 0 to N and module 2, then you get a generator of 1 and 0:

Function* rand() ( const n = 100; const mod = 2; let i = 0; while (true) ( ​​yield i % mod; if (i++ > n) i = 0; ) ) let i = 0; for (let x of rand()) ( if (i++ > 100) break; console.log(x); )
This function generates for us the sequence 01010101010101 ... and it cannot even be called pseudo-random. For a generator to be random, it must pass the test for the next bit. But we do not have such a task. Nevertheless, even without any tests, we can predict the next sequence, which means that such an algorithm is not suitable in the forehead, but we are in the right direction.

But what if we take some well-known, but non-linear sequence, for example, the number PI. And as a value for the module, we will take not 2, but something else. You can even think about the changing value of the module. The sequence of digits in Pi is considered random. The generator can work using pi starting from some unknown point. An example of such an algorithm, with a PI-based sequence and modulo change:

Const vector = [...Math.PI.toFixed(48).replace(".","")]; function* rand() ( for (let i=3; i<1000; i++) { if (i >99) i = 2; for (let n=0; n But in JS, the number PI can only be displayed up to 48 characters and no more. Therefore, it is still easy to predict such a sequence, and each run of such a generator will always produce the same numbers. But our generator has already begun to show numbers from 0 to 9.

We got a number generator from 0 to 9, but the distribution is very uneven and it will generate the same sequence every time.

We can take not the number Pi, but the time in numerical representation and consider this number as a sequence of digits, and in order to prevent the sequence from repeating each time, we will read it from the end. In total, our algorithm for our PRNG will look like this:

Function* rand() ( let newNumVector = () => [...(+new Date)+""].reverse(); let vector = newNumVector(); let i=2; while (true) ( ​​if ( i++ > 99) i = 2; let n=-1; while (++n< vector.length) yield (vector[n] % i); vector = newNumVector(); } } // TEST: let i = 0; for (let x of rand()) { if (i++ >100) break; console.log(x) )
Now it looks like a pseudo-random number generator. And the same Math.random() - is a PRNG, we'll talk about it a little later. Moreover, each time the first number is different.

Actually on these simple examples you can understand how more complex random number generators work. And there are even ready-made algorithms. For example, let's analyze one of them - this is the Linear Congruent PRNG (LCPRNG).

Linear congruent PRNG

Linear Congruential PRNG (LCPRNG) -  is a common method for generating pseudo-random numbers. It does not have cryptographic strength. This method consists in calculating the terms of a linear recurrent sequence modulo some natural number m given by a formula. The resulting sequence depends on the choice of the starting number - i.e. seed. For different seed values, different sequences of random numbers are obtained. An example of the implementation of such an algorithm in JavaScript:

Const a = 45; const c = 21; const m = 67; varseed = 2; const rand = () => seed = (a * seed + c) % m; for(let i=0; i<30; i++) console.log(rand())
Many programming languages ​​use LCPRNG (but not just such an algorithm (!).

As mentioned above, such a sequence can be predicted. So why do we need PRNG? If we talk about security, then PRNG is a problem. If we talk about other tasks, then these properties  -  can play a plus. For example, for various special effects and graphics animations, you may need to call random frequently. And here the distribution of values ​​​​and performance are important! Security algorithms cannot boast of speed.

Another property - reproducibility. Some implementations allow you to specify a seed, which is very useful if a sequence is to be repeated. Reproduction is necessary in tests, for example. And there are many other things that do not require a secure RNG.

How Math.random() works

The Math.random() method returns a pseudo-random floating point number from the range = crypto.getRandomValues(new Uint8Array(1)); console log(rvalue)
But, unlike PRNG Math.random(), this method is very resource intensive. The fact is that this generator uses system calls in the OS to access entropy sources (poppy address, cpu, temperature, etc ...).

Please help the service with one click: Tell your friends about the generator!

Number generator online in 1 click

The random number generator, which is presented on our website, is very convenient. For example, it can be used in drawings and lotteries to determine the winner. Winners are determined in this way: the program gives out one or more numbers in any range you specify. The manipulation of the results can be immediately eliminated. And thanks to this, the winner is determined in a fair choice.

Sometimes you need to get a certain number of random numbers at once. For example, you want to fill out a “4 out of 35” lottery ticket, trusting in chance. You can check: if you flip a coin 32 times, what is the probability that 10 reverses will fall out in a row (heads / tails may well be assigned by the numbers 0 and 1)?

Random number online video instruction - randomizer

Our number generator is very easy to use. It does not require downloading a program to a computer - it can be used online. To get the number you need, you need to set the range of random numbers, the number and, if desired, the number separator and exclude repetitions.

To generate random numbers in a specific frequency range:

  • Choose a range;
  • Specify the number of random numbers;
  • The "Number separator" function serves for the beauty and convenience of their display;
  • If necessary, enable / disable repetitions with a checkmark;
  • Click the "Generate" button.

As a result, you will receive random numbers in a given range. The result of the number generator can be copied or sent to e-mail. It would be best to take a screenshot or video of this generation process. Our randomizer will solve any of your problems!

A clear and convenient online number generator, which has recently gained popularity. Received the greatest distribution during the drawing of prizes in social networks, among users.

It is also popular in other areas. Also we have or passwords and numbers.

Our random number generator online.

Our randomizer generator does not require you to download it to your personal PC. Everything happens in the online number generator mode. Just specify parameters such as: a range of online numbers in which numbers will be randomly selected. Also specify the number of numbers to be selected.

For example, you have a Vkontakte group. In a group, you are drawing 5 prizes, among the number of participants who repost the entry. With the help of a special application, we received a list of participants. Each was assigned a serial number for numbers online.

Now we go to our online generator and indicate the range of numbers (number of participants). For example, we ask that 5 numbers are needed online, since we have 5 prizes. Now we press the generate button. Then we get 5 random numbers online, in the range from 1 to 112 inclusive. The generated 5 numbers online will correspond to the serial number of the five participants who became the winners of the draw. Everything is simple and convenient.

Another plus of the random number generator is that all online numbers are randomly generated. That is, it is not possible to influence it, or to calculate what number will be next. What makes it honest and reliable, and the administration, which draws prizes with the help of our free generator, is honest and decent in the face of the contestants. And if you are in doubt about a solution, then you can use our

Why random number generator is the best?

The fact is that number generator online available on any device and always online. You can quite honestly generate any number for any of your ideas. And the same for the project to use random number generator online. Especially if you need to determine the winner of the game or for a different number online. The fact is that random number generator generates any numbers completely randomly without algorithms. It's basically the same for numbers.

Random number generator online for free!

Random number generator online for free for everyone. You don't need to download or buy any random number generator online for a draw. You just need to go to our website and get the result you need randomly. We have not only random number generator but also needed by many who will definitely help you win the lottery. A real online random number generator for lotteries is an absolute accident. Which our site is able to provide you.

Random number online

If you are looking for a random number online, then we have created this resource just for you. We are constantly improving our algorithms. You get real here random number generator. It will provide any need as a random generator you need completely free of charge and at any time. Generate random numbers online with us. Always be sure that each generated number is completely random.

Random number generator

Our random number generator randomly selects numbers completely randomly. It doesn't matter what day or hour you have on your computer. This is a real blind choice. The random generator simply shuffles all the numbers randomly. And then randomly chooses from them the number of random numbers you specified. Sometimes the numbers can be repeated, which proves the complete randomness of the random number generator.

Random online

Random is the surest option for the draw. The online generator is really a random choice. You are protected from any influence on the choice of a random number. Filming the process of random online selection of the winner on video. That's all you need. Play fair online pranks with our online number generator. You get winners and satisfied players. And we are glad that we were able to please you with our random generator.

Description of the generator

Our free online generator is designed to generate random integers. It can easily be used, for example, to determine the winning number of your lottery, draw or contest.

Number of simultaneously generated numbers: from 1 to 999. By default, one number is generated.

The available range of numbers is from 1 to 99,999,999 inclusive. In this case, the final value of the range must be greater than the initial value. By default, the range from 1 to 100 is used to generate a random number.

Generated numbers can be sorted: randomly (by default), in descending order, and also in ascending order.

When displaying numbers in the result block, you can use separators: a space (by default), a comma, as well as a combination of "comma + space".

When generating several numbers, the same ones may appear. By default, duplicates are removed. If you allow the same numbers as a result, then just remove the bird in the field "Number Repetitions".

The generator also allows you to copy the result to the clipboard. To do this, use the "Copy" button, the result will be automatically placed on the clipboard.

If you need to return the values ​​of all fields to their original state, you should click the "Reset" button.

A few words about accidents

No matter how surprising it may be for an ordinary person, but random numbers play a very important role in various areas of human activity, where sequences of random numbers are required, which no one can predict. The best known examples for us are lotteries or online casinos. After all, if such sequences turn out to be not completely random and someone can trace the order in them, he can easily apply this knowledge to his own interests. So in 1873, the British engineer Joseph Jagger, along with six of his assistants, went to the casino and began to write down the numbers on the roulette tables. Imagine, but he found that on one of the roulettes, some numbers fall out much more often than others, i.e. are not so random! It was then that he began to put money on these numbers. And although the casino owners suspected something was wrong and tried to somehow remedy the situation by rearranging the tables from place to place, this did not help them. Jagger won a total of about $5 million in today's money from them.

Random numbers are also needed in cryptography, for example, to encrypt network traffic or carry out banking transactions. If the generated sequences of random numbers have easily detectable patterns, attackers will be able to intercept outgoing traffic and harm the user's computer or steal his confidential data.

In addition, random numbers are used in various scientific and engineering fields for computer simulation of real natural processes, in statistics, which itself is based on chance, in various games of chance (not only because roulette requires randomness), etc.

As you can see, chances are in demand. But is it easy to get really high-quality random sequences of numbers or characters? Let's say right away that it is theoretically possible to create such a generator, but it is very difficult to do it in practice. That is why the numbers obtained using various mathematical algorithms are called pseudo-random. There are many varieties of pseudo-random number generators that use the most sophisticated algorithms, but they are still not perfectly random. However, the greater the number of different initial conditions that make it difficult to predict each subsequent sequence number is used in the generator, the more reliable it is.

So where do truly random events take place? At the moment, science believes that the events of quantum mechanics should be considered random. According to the Heisenberg uncertainty principle, we cannot measure all the necessary parameters of a quantum object with arbitrarily high accuracy. Moreover, in principle we cannot, and not because we do not have enough technical capabilities. And since it is impossible to measure all the initial parameters, it means that it is impossible to predict the exact outcome of the process.

Thus, it is quantum generators that should be considered the highest quality random number generators, i.e. those that use quantum processes in their work.