C
CalcFusionHub
ConvertersFinancialHealthMath & EducationEngineeringBusiness♥ Favorites
Home›Calculators›Math & Education›Random Number Generator
🧮

Random Number Generator

Generate random numbers within a custom range — integers or decimals, single values or lists, unique (no repeats) or with repetition allowed.

Loading…

Related Calculators

🔐
Password Generator
Free password generator — create strong, random passwords locally in your browser with length, symbol, and look-alike options.
🎲
Dice Roller
Free online dice roller — roll d4 to d100, multiple dice, and a modifier for board games and tabletop RPGs, with the total and average.
🎰
Lottery Number Generator
Generate random lottery numbers for Powerball, Mega Millions, EuroMillions, Lotto 6/49, or any custom draw — with jackpot odds.
🧱
Rectangular Prism Calculator
Calculate the volume, surface area, and space diagonal of a rectangular prism (box) from length, width, and height.
📐
Hypotenuse Calculator
Find the hypotenuse of a right triangle from its two legs using the Pythagorean theorem.
🔺
Right Triangle Side and Angle Calculator
Solve any right triangle for missing sides and angles from any two known values.
View all Math & Education →
C
CalcFusionHub

Free online calculators and converters for finance, health, math, and everyday life.

calcfusionhub.com

Converters

  • Length Converter
  • Weight Converter
  • Temperature Converter
  • Area Converter
  • Volume Converter
  • Speed Converter
  • View all →

Calculators

  • BMI Calculator
  • Loan Calculator
  • Mortgage Calculator
  • Compound Interest
  • Age Calculator
  • ROI Calculator
  • View all →

Company

  • About
  • For Teachers
  • Contact
  • Privacy Policy
  • Terms of Service
  • ♥ Favorites

© 2026 CalcFusionHub. All rights reserved.

Privacy PolicyTerms of ServiceContact

Results are for informational purposes only. Always verify with a qualified professional.

Decimal numbers
Unique numbers only (no repeats)
Use seed (reproducible)

Instant insight

  • This generator is pseudo-random, not truly random

    The output comes from a deterministic algorithm. It passes statistical tests for randomness but is computed, not sampled from the physical world.

    Fine for games, sampling and simulations. Not fine for cryptography or anything security-related, which needs a generator designed for it.

  • Random does not mean evenly spread

    People routinely reject real random sequences as "not random enough" because they contain runs and clumps.

    Do not regenerate until a set looks right — that biases the result away from randomness.

Worked out in your browser — nothing is sent anywhere.

Everyday Uses

🎁

Fair giveaways

Pick contest and raffle winners with genuinely random draws instead of "eyes closed" scrolling.

🎲

Games without dice

Lost the dice? Generate rolls for board games, RPGs, or deciding who goes first.

👨‍🏫

Classroom picks

Teachers can call on students or form random groups without bias.

📊

Sampling and testing

Pick random samples for quality checks, surveys, or A/B test assignment.

🔬

Randomised assignment

Allocate participants to groups, or plots to treatments, without letting an unconscious preference decide. Randomisation is what makes the comparison fair.

🎲

Monte Carlo estimates

Repeated random draws approximate answers that are awkward to compute directly — estimating risk, queue lengths, or π by throwing darts at a square.

Frequently Asked Questions

How does a random number generator work?

Computer-based random number generators (RNGs) fall into two categories. Pseudo-random number generators (PRNGs) — use a mathematical algorithm seeded with an initial value (the "seed") to produce sequences that appear random but are deterministic and reproducible. Common algorithms: Mersenne Twister (MT19937, used in Python, R, MATLAB), Xorshift, Linear Congruential Generator. Given the same seed, a PRNG always produces the same sequence — useful for reproducible experiments. JavaScript's Math.random() uses an implementation-defined PRNG. True random number generators (TRNGs) — harvest entropy from physical sources: atmospheric noise (Random.org), thermal noise, mouse movement, keystroke timing. These are genuinely unpredictable and are used in cryptography and secure key generation. For most everyday uses (games, sampling, simulations), PRNGs are indistinguishable from true randomness.

How do I generate a random number between 1 and 100?

The formula for a random integer in the range [min, max] is: Math.floor(Math.random() × (max − min + 1)) + min. For 1 to 100: Math.floor(Math.random() × 100) + 1. Math.random() returns a float in [0, 1) — it includes 0 but never reaches 1. Multiplying by (max − min + 1) scales to [0, 100). Math.floor() rounds down to the nearest integer [0, 99]. Adding min (1) shifts the range to [1, 100]. For a random float in [min, max]: Math.random() × (max − min) + min. Example: random float in [2.5, 7.5] = Math.random() × 5 + 2.5.

What is a random number seed and why does it matter?

A seed is the starting value that initialises a pseudo-random number generator (PRNG). Same seed → identical sequence every time. Different seeds → different sequences. Why seeds matter: Reproducibility in science — a researcher specifies the seed so others can reproduce the exact same "random" results: numpy.random.seed(42) in Python. Debugging — when testing code involving randomness, fixing the seed makes bugs reproducible. Gaming — some games use seeds to generate the same world for all players (e.g., Minecraft world seeds). Security — cryptographic applications must use unpredictable seeds (entropy from hardware) to prevent attackers from reproducing key sequences. Common reproducible seeds in examples: 42 (Douglas Adams joke, widely used in data science), 0, 123, 2024.

What are common uses of random number generators?

RNGs are fundamental across many fields. Statistics & research — random sampling from a population; assigning participants to treatment/control groups in experiments; bootstrapping and Monte Carlo simulation. Games & entertainment — dice rolling, card shuffling, procedural world generation (Minecraft, No Man's Sky), loot drops, NPC behaviour. Cryptography — generating encryption keys, session tokens, one-time passwords, SSL/TLS nonces. These require cryptographically secure RNGs (CSPRNGs). Computer science — randomised algorithms (quicksort random pivot), hash table randomisation, load balancing. Finance — Monte Carlo simulations for option pricing, portfolio stress testing, risk modelling. Education — generating unique exam questions, random group assignment, lottery draws. A simple use: randomly assign numbers 1–30 to 30 students for a class lottery.

What is the difference between random numbers with and without replacement?

With replacement (repetition allowed) — each number is drawn independently; the same value can appear multiple times. Analogous to rolling a die multiple times — 4 can appear on roll 1 and again on roll 3. Example: generating 5 numbers in [1, 10] with replacement might give: 3, 7, 3, 10, 3. Without replacement (unique) — once a number is drawn, it cannot be drawn again. Analogous to drawing cards from a shuffled deck without putting them back. Example: 5 unique numbers from [1, 10]: 3, 7, 1, 9, 5. Without replacement requires tracking previously drawn values and requires that you request no more numbers than are available in the range (you cannot draw 15 unique numbers from a range of 10). Without replacement is used for: lottery draws, random sampling surveys, raffle ticket selection, creating shuffled sequences. With replacement is used for: bootstrapping in statistics, dice/coin simulations, and any situation where independence between draws is required.