Calculators

How Random Number Generators Work (and What Makes a Draw Fair)

ToolOrbit Team 3 min readUpdated
How Random Number Generators Work (and What Makes a Draw Fair)

Whether you are running a giveaway, assigning tasks, sampling data, or simulating dice rolls, you need numbers that are genuinely unpredictable. The ToolOrbit Random Number Generator produces crypto-secure random integers within any range you choose, with options for unique values and sorted results, all directly in your browser.

🎲 Use the free Random Number Generator now: /tools/random-number-generator/ — supports 1–100 ranges, no repeats, sorted output, and runs entirely in your browser.

How the random number generator works

Many simple tools rely on Math.random(), which is fast but predictable and not suitable when fairness or security matters. The ToolOrbit Random Number Generator instead uses crypto.getRandomValues, the browser's cryptographically secure random source. It also maps those raw values into your chosen range carefully to avoid modulo bias, the subtle skew that can make some numbers more likely than others.

  • Define a minimum and maximum to set the inclusive range
  • Choose how many numbers to generate at once
  • Enable unique mode to draw without repeats, ideal for raffles and sampling
  • Enable sorted output to return results in ascending order

Drawing random numbers in practice

Set your range, enter how many numbers you want, and toggle the unique and sorted options to fit your task. For a prize draw, set the range to your number of entries, request a single value or several unique winners, and generate. The results appear instantly and can be copied with one click.

  • Giveaways and raffles: use unique mode to pick distinct winners
  • Team assignments: shuffle people into groups fairly
  • Statistics: draw random samples from a numbered dataset
  • Games and simulations: roll dice or generate test data

Tips for fair results

For transparent giveaways, announce your range and rules before generating, then capture the result on screen so participants can trust the outcome. When sampling data, unique mode prevents the same record from being selected twice. The ToolOrbit Random Number Generator makes all of this fast, private, and statistically sound, so you can rely on every result.

Random vs fair — they are different things

A uniformly random pick between 1 and N gives every value the same chance, which is what a raffle wants. “Fair” can mean more: nobody gets picked twice until everyone has been picked once. Ordering a group with no repeats is shuffling, not sampling, and needs the no-repeat workflow. For crypto-adjacent work, reach for the cryptographically secure generator; for games and mockups, the ordinary PRNG is fine — the distinction matters only when money or secrets are involved.

  • Reproducible runs: a fixed seed lets a test suite replay the same numbers.
  • Lottery style: never let the same entry appear twice per draw.
  • Sample size: asking the generator for the same range a second time is a fresh roll, not a retry.

Frequently asked questions

Open the Random Number Generator, set the minimum to 1 and the maximum to 100, choose how many numbers you want, and click Generate. It is free, instant, and private.

Yes. Math.random() is fast but predictable and can be biased. crypto.getRandomValues uses a cryptographic random source so each number has an equal, unpredictable chance of being drawn.

Yes. Enable unique mode, set the range to your number of entries, and draw one or more winners without repeats. Announce the range first for a transparent, verifiable draw.


Tools mentioned

More reading

View all guides
How to Calculate Percentages: 3 Formulas with Examples
Calculators

How to Calculate Percentages: 3 Formulas with Examples

The three percentage formulas, worked examples, common mistakes, and the difference between percent and percentage points.

2 min readUpdated
What Is BMI? Formula, Categories and Limitations
Calculators

What Is BMI? Formula, Categories and Limitations

How body mass index is calculated, what the categories mean, a worked example, and the limits of BMI as a health measure.

2 min readUpdated
How Age Is Calculated in Years, Months and Days
Calculators

How Age Is Calculated in Years, Months and Days

How an exact age is worked out from two dates, why months make it tricky, and how to count down to a birthday.

2 min readUpdated
Counting Days Between Dates: Inclusive vs Exclusive
Calculators

Counting Days Between Dates: Inclusive vs Exclusive

Should you count the first day, the last day or both? How inclusive and exclusive day counting differ, plus leap years and business days.

2 min readUpdated
How to Calculate a Tip and Split the Bill
Calculators

How to Calculate a Tip and Split the Bill

The simple maths behind a tip, a worked example for splitting a bill, and a rough guide to tipping customs around the world.

2 min readUpdated
How to Calculate a Discount, Stacked Deals and Sales Tax
Calculators

How to Calculate a Discount, Stacked Deals and Sales Tax

How percentage discounts are worked out, why two stacked discounts are less than their sum, and where tax fits in.

2 min readUpdated
Unit Conversion Basics: Length, Weight, Temperature and Data
Calculators

Unit Conversion Basics: Length, Weight, Temperature and Data

The conversions worth knowing by heart, why temperature needs a formula and not a single factor, and a quick worked example.

2 min readUpdated
How Many Days Between Two Dates? (Calculator + Manual Method)
Calculators

How Many Days Between Two Dates? (Calculator + Manual Method)

Calculate exact days between two dates: understand inclusive vs exclusive counting, leap years, working days, and manual calculation formulas.

2 min readUpdated