← All articles Guides

How to Use a Random Number Generator

A random number generator is the tool for when the options aren't names but numbers: a number between 1 and 100, a decimal test value, an index to pick from a list you keep elsewhere. This guide covers the Random Number Generator and the mistakes people make with ranges.

Setting a range

Enter a minimum and a maximum, then generate. By default you get a whole number in that range, inclusive β€” min 1, max 10 can return a 1 or a 10, not just 2 through 9. That inclusiveness is the single most common point of confusion. If you need 1–10 without the endpoints, set 2–9.

Whole numbers vs. decimals

Use integers for counting (picking a numbered seat, a lottery number, a page in a book). Use decimals when you're generating test data, simulating a percentage, or need a value between 0 and 1. You can control how many decimal places you get.

The off-by-one trap

"Pick a number from 1 to 6" and "roll a die" should give the same answers β€” both inclusive of 1 and 6. If your generator treats the max as exclusive, your "d6" is really a d5 plus one and the distribution is wrong. Always check whether the max is included, and state the range out loud when it matters.

Uniform means uniform

A good generator gives every value in the range equal probability. That matters in tests: if you generate 1–100 a thousand times, each value should appear about ten times. Run it a few thousand times and check β€” that's how you demo the law of large numbers, and how you catch a bad generator.

Practical uses

TaskSetup
Lottery / door prize numberIntegers 1–N inclusive
Pick a page to read toIntegers 1–total pages
Test dataDecimals, several places
Random delay simulationDecimals in seconds
Assign a number to each studentIntegers 1–class size

If your options have names instead of numbers, the wheel is usually clearer β€” people can see the options. Use numbers when the list lives elsewhere or you genuinely just need a value.

Generate a number

Set your min and max and generate β€” integers or decimals, inclusive ranges.

Open the generator β†’