Skip to content
AgileLogics

Random Fraction Generator

Generates one or more random proper fractions, reduced to their simplest form.

How it works

Choose a maximum denominator and how many fractions, then click Generate.

How does a random fraction generator work?

It picks a random denominator, then a random numerator smaller than it, and divides both by their greatest common divisor so the fraction is in simplest form. This tool returns proper fractions only, between 0 and 1, with a denominator no larger than the maximum you set. It runs in your browser using the Web Crypto random source.

Making a set of fractions

  1. Set Max denominator (2 to 1000, default 100). Use 10 or 12 for primary-school worksheets, 100 or more for harder practice.
  2. Set Fractions to how many you want (1 to 50).
  3. Click Generate. Each fraction appears on its own line as numerator/denominator.

Repeats are possible; each fraction is drawn independently.

Example with denominators up to 12

With Max denominator 12 and Fractions 10, one run returned:

2/9
2/3
2/11
9/11
2/9
4/5
1/3
6/7
1/3
1/4

Ten fractions and three duplicates (2/9 twice, 1/3 twice). That's normal for a small denominator limit: there are only 45 distinct proper fractions in lowest terms with denominators from 2 to 12.

How the reduction works

The tool reduces each fraction with Euclid's algorithm, which finds the greatest common divisor (GCD) by repeatedly replacing the pair (a, b) with (b, a mod b) until the remainder is 0. For a draw of 18/24:

Step a b a mod b
1 18 24 18
2 24 18 6
3 18 6 0
4 6 0 stop: GCD is 6

Dividing both parts by 6 gives 3/4. Every output is already in lowest terms, so you can use the generator to check answers to a "simplify this fraction" exercise, or deliberately multiply results back up (3/4 to 9/12) to make simplification questions.

How often each fraction appears

Because the tool chooses the denominator first and then reduces, the results aren't spread evenly over the distinct fractions. Fractions with many equivalent forms appear more often. These shares were calculated exactly from the tool's method:

Max denominator Distinct possible fractions Share that is 1/2 Share of draws already in lowest terms
12 45 17.1% 74.5%
100 3,043 3.0% 63.5%

The distinct counts are sums of Euler's totient φ(d) for d = 2 to the maximum, the sequence listed as OEIS A002088 (minus 1, since that sequence also counts 1/1). The rarest results are fractions like 11/12 or 99/100, whose denominator only appears when it's drawn directly with a coprime numerator.

For a worksheet, that skew is mostly a good thing: halves, thirds and quarters are the fractions students meet most, and they show up often enough to build fluency. If you want an even spread of harder fractions, raise the maximum denominator; the share of 1/2 falls quickly as the limit grows.

Ideas for using random fractions

  • Comparison drills. Generate pairs and ask which is larger. 6/7 versus 4/5 is a good one: cross-multiply, 30 against 28, so 6/7 wins.
  • Arithmetic practice. Take two results and add, subtract, multiply or divide them, then check the answer with the fraction calculator.
  • Fraction to decimal and percent. Convert each result and confirm with the percentage calculator. Fractions whose reduced denominator has only 2 and 5 as prime factors (1/4, 4/5) terminate; others such as 2/9 repeat.
  • Ratios. Read 2/3 as the ratio 2:3 and scale it up or down with the ratio calculator.
  • Test data. Developers writing a rational-number class or a fraction parser can paste a batch in as input and compare the parsed values against a known-good implementation.

When you need decimal values instead, the random decimal generator produces numbers between any two bounds at a fixed precision.

Limits

The tool doesn't produce improper fractions, mixed numbers, negative fractions or a fixed denominator (for example "only twelfths"). The slider tops out at a denominator of 1000. Randomness comes from crypto.getRandomValues through a rejection-sampled integer pick (MDN), and nothing you generate leaves the page.

Last updated

Frequently asked questions

Does it generate improper fractions or mixed numbers?
No. Every result is a proper fraction strictly between 0 and 1, such as 3/8. The numerator is always at least 1 and smaller than the denominator, so you never get 0, 1, whole numbers, improper fractions or mixed numbers.
Why are the denominators often smaller than my maximum?
Two reasons. The denominator is chosen at random from 2 up to your maximum, so most fractions use a smaller one, and the fraction is then reduced. A draw of 6/8 is shown as 3/4.
Why does 1/2 come up so often?
Many different draws reduce to it (1/2, 2/4, 3/6 and so on). With a maximum denominator of 12, about 17% of results are 1/2; with 100 it's about 3%. Simple fractions are over-represented compared with picking uniformly from the list of distinct fractions.
Can I get negative fractions?
No. All results are positive proper fractions. For a worksheet that needs negatives, add the sign yourself to some of the results.