Passer au contenu principal

Générateur de nombres aléatoires

Random numbers power everything from games and simulations to cryptography and statistical sampling. Our generator produces truly random integers, floats, and sequences using cryptographically secure randomness (CSPRNG via the Web Crypto API), with options for unique sequences, weighted randomness, and Gaussian (normal) distribution.

150100

Résultats

Dernière génération

Nombre
Résultat minimum
Résultat maximum
Sum

Cliquez sur Générer pour obtenir des nombres

Cas d'usage courants

Choisir des numéros de loterie 1–49, count: 6, no duplicates
Pourcentage aléatoire 0–100, decimals on
Mélanger l'ordre de l'équipe 1–10, count: 10, no duplicates
Partager cet outil
Developer Tools

À propos de Random Number Generator

Random numbers power everything from games and simulations to cryptography and statistical sampling. Our generator produces truly random integers, floats, and sequences using cryptographically secure randomness (CSPRNG via the Web Crypto API), with options for unique sequences, weighted randomness, and Gaussian (normal) distribution.

Comment l'utiliser

  1. Set your range (min and max values) and how many numbers to generate.
  2. Toggle unique mode to generate a non-repeating sequence (like lottery numbers).
  3. Choose distribution: uniform (default), Gaussian (normal), or weighted.
  4. See generated numbers with statistical analysis (mean, min, max, std dev).

Formule et méthodologie

Uniform integer: Math.floor(crypto.getRandomValues(new Uint32Array(1))[0] / 2^32 × (max − min + 1)) + min. Gaussian: Box-Muller transform on two uniform randoms: Z = sqrt(-2 × ln(U1)) × cos(2π × U2). Uniform float [0,1): getRandomValues byte / 256, chained for precision. CSPRNG vs Math.random(): crypto API is unpredictable; Math.random() is deterministic given seed.

Cas d'usage courants

  • Lottery and raffle: picking winners from a list
  • Game development: dice rolls, card shuffles, procedural generation
  • Statistical sampling: selecting random survey participants
  • Security: generating tokens, nonces, and one-time codes
  • A/B testing: random assignment of users to experiment groups

Questions fréquentes

No — Math.random() is a pseudorandom number generator (PRNG), producing a deterministic sequence from an internal seed. It's unpredictable enough for games and simulations but should never be used for security tokens, encryption keys, or anything requiring unpredictability. For security: use crypto.getRandomValues() in browsers or crypto.randomBytes() in Node.js. These use hardware entropy sources for genuine unpredictability.
Array selection: items[Math.floor(Math.random() × items.length)]. For security: const array = new Uint32Array(1); crypto.getRandomValues(array); items[array[0] % items.length]. For weighted selection: assign cumulative weights (item A: 0–0.5, item B: 0.5–0.8, item C: 0.8–1.0) and find which bucket a uniform random number falls in. Our tool handles weighted lists with custom probability assignments.

Outils connexes

Tous les outils →

Intégrer cet outil sur votre site

Gratuit pour usage personnel et commercial. Copiez simplement le code ci-dessous.