تخطى إلى المحتوى الرئيسي

مولد أرقام عشوائية

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

النتائج

آخر توليد

العدد
أصغر نتيجة
أكبر نتيجة
Sum

انقر توليد للحصول على أرقام

حالات الاستخدام الشائعة

اختر أرقام اليانصيب 1–49, count: 6, no duplicates
نسبة عشوائية 0–100, decimals on
خلط ترتيب الفريق 1–10, count: 10, no duplicates
شارك هذه الأداة
Developer Tools

حول 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.

كيفية الاستخدام

  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).

الصيغة والمنهجية

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.

حالات الاستخدام الشائعة

  • 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

الأسئلة الشائعة

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.

أدوات ذات صلة

كل الأدوات →

دمج هذه الأداة في موقعك

مجاني للاستخدام الشخصي والتجاري. فقط انسخ الكود أدناه.