Generate Random Numbers on Casio Calculator

How-to basics · Updated November 23, 2026

Yes, you can generate random numbers on most Casio scientific and graphing calculators using the Ran# function (or RanInt# on newer models). For example, on a Casio fx-991EX, press OPTN > PROB > Ran# and then = to get a random decimal between 0 and 1. This article explains the exact steps for common models, how to generate integers in a range, and how to avoid common pitfalls.

What the Ran# Function Does

The Ran# function (short for “random number”) returns a pseudo-random decimal value in the interval [0, 1). That means it can return 0 but never returns exactly 1. For example, you might get 0.473, 0.892, or 0.001. Each press of the = key after entering Ran# produces a new value. The numbers are generated by a deterministic algorithm, so they are not truly random in a cryptographic sense, but they are uniformly distributed and sufficient for most educational or simulation purposes.

On Casio calculators that have a RanInt# function (introduced on models like the fx-991EX, fx-991CW, and fx-CG50), you can generate random integers within a specified range. The syntax is RanInt#(a, b), where a is the lower bound and b is the upper bound, both inclusive. For instance, RanInt#(1, 6) simulates a die roll.

Step-by-Step: Casio fx-991EX and fx-991CW

These are the most common scientific calculators in schools. The steps are nearly identical for both.

  1. Turn on the calculator and press MENU.
  2. Select the “Calculate” mode (usually option 1) and press =.
  3. Press OPTN (the option key).
  4. Press F6 (or the right arrow) to scroll to the “PROB” menu. On the fx-991CW, you may need to press TOOLS and then find “Random”.
  5. Select Ran# (or RanInt#).
  6. If you chose RanInt#, type the lower bound, a comma, the upper bound, and then close the parenthesis. For example: RanInt#(1, 100).
  7. Press = to get a random number. Each subsequent press of = generates a new one.

On the fx-991CW, the menu path is slightly different: press TOOLS > Random > Ran# or RanInt#. If you don’t see the option, check that you are in the Calculate mode.

Generating Random Integers in a Range

To get a random integer between two values, use RanInt#(a, b). This is available on most Casio calculators manufactured after 2010, including the fx-991EX, fx-991CW, fx-9750GII, and fx-CG50. The function is inclusive of both endpoints, so RanInt#(1, 10) can return 1, 2, …, 10.

If your calculator does not have RanInt# (for example, older fx-82MS models), you can simulate it manually. To get a random integer from 1 to N, use the formula: Int(Ran# × N) + 1. The Int function truncates the decimal part, so Ran# × N gives a value from 0 to just under N, and adding 1 shifts it to 1 through N. For example, to simulate a die roll on an older model, enter Int(Ran# × 6) + 1.

Common Problems and Misconceptions

Many users expect Ran# to give a whole number, but it gives a decimal. If you need an integer, you must use RanInt# or the Int trick. Another common issue is that the random sequence repeats if you reset the calculator or change the “seed”. The seed is a starting value for the algorithm. On Casio calculators, the seed is automatically updated each time you generate a number, but if you turn off the calculator, the next time you turn it on, the sequence may start from the same point unless you manually set a new seed. To set a seed, you can use the Ran# function with a negative argument? Actually, no—Casio does not provide a direct seed command on most models. However, you can “randomize” by entering a large number and then pressing = repeatedly, or by using the Ran# function after a reset. On the fx-991EX, there is no explicit seed setting, but the internal clock is used when the calculator is turned on, so the sequence is different each time you power up.

Casio Graphing Calculators (fx-9750GII, fx-CG50)

Graphing calculators have the same functions but accessed via the OPTN menu. On the fx-CG50, press MENU > Run-Matrix (or Calculate), then press OPTN > PROB > RAND. You will see Ran# and RanInt#. The syntax is identical. For example, to generate a random integer between 1 and 100, type RanInt#(1, 100) and press EXE (the execute key).

On older graphing models like the fx-9750GII, the path is OPTN > PROB > RAND. If you have a very old model, check the manual—some use Ran# only.

Using Random Numbers for Simulations and Games

Random numbers on a Casio are handy for quick simulations without a computer. For example, you can simulate coin flips by generating RanInt#(0, 1) where 0 = heads and 1 = tails. For a dice roll, use RanInt#(1, 6). To pick a random student from a class of 30, use RanInt#(1, 30). For probability experiments, you can generate 100 random numbers and count how many fall in a certain range—though doing that manually is tedious, but you can use the calculator’s list features on graphing models to store results.

Alternatives and Limitations

If you need truly random numbers (for cryptography or scientific rigor), a calculator’s pseudo-random generator is not suitable. The sequence is deterministic and can be predicted if you know the algorithm and seed. For serious applications, use a dedicated random number generator or a computer with a hardware random source. Also, the Ran# function on Casio calculators has a period (the sequence repeats after a large number of values), but that period is long enough for typical classroom use.

If your calculator does not have a Ran# function at all (some very basic models), you can use the sin function trick: take the fractional part of sin(x) × 10000 for some x, but this is not recommended because it is not uniform and is hard to reproduce. Better to upgrade to a model with Ran#.

Frequently Asked Questions

How do I get a random number between 1 and 10 on my Casio fx-991EX?
Use RanInt#(1, 10). Press OPTN > PROB > RanInt#, then type 1, comma, 10, close parenthesis, and press =.

Why does my calculator always give the same random number after reset?
After a reset, the seed is set to a default value, so the first random number will be the same each time. To avoid this, turn the calculator off and on again, or generate a few numbers and discard them. On many models, the seed is updated by the internal clock when you power on, so simply turning it off and on gives a different sequence.

Can I generate random numbers on a Casio fx-82MS?
Yes, but it only has Ran# (not RanInt#). To get an integer, use Int(Ran# × N) + 1. For example, for a random number from 1 to 100, enter Int(Ran# × 100) + 1.

What is the difference between Ran# and RanInt#?
Ran# returns a decimal between 0 and 1 (inclusive of 0, exclusive of 1). RanInt# returns an integer within a specified range, inclusive of both endpoints. Use RanInt# when you need whole numbers.

Is there a way to set a seed on a Casio calculator?
Most Casio calculators do not have a direct seed command. However, you can influence the seed by pressing = multiple times or by turning the calculator off and on. On some graphing models, you can store a value in a variable and use it in a formula, but that does not directly set the random seed. For reproducible sequences, you would need to use a computer.

Can I generate random numbers in a list on a graphing calculator?
Yes, on fx-9750GII or fx-CG50, you can use the Seq command to generate a list of random numbers. For example, Seq(Ran#, X, 1, 10, 1) creates a list of 10 random decimals. This is useful for statistical simulations.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.