learn.howToCalculate
learn.whatIsHeading
A random number generator produces numbers with no predictable pattern within a specified range. Computers generate pseudorandom numbers using deterministic algorithms seeded by a starting value. True random numbers require physical entropy sources.
Guide étape par étape
- 1JavaScript: Math.random() returns a float from 0 (inclusive) to 1 (exclusive)
- 2Integer from min to max: Math.floor(Math.random() × (max - min + 1)) + min
- 3Cryptographic: crypto.getRandomValues() — suitable for security applications
- 4Distribution: uniform (equal probability for each value) by default
Exemples résolus
Entrée
Range 1–100
Résultat
Random integer: e.g. 47
Prêt à calculer ? Essayez la calculatrice gratuite Random Number Generator
Essayez-le vous-même →