Random Fraction Generator

Produces random fractions in the form a/b, with independently configurable numerator and denominator ranges and an option to reduce each fraction to lowest terms using the greatest common divisor — useful for math worksheets, practice problems, and probability demonstrations. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool generates random fractions in a/b form, with separately configurable ranges for the numerator and denominator.

An optional lowest-terms reduction uses the greatest common divisor, so you can generate either raw or simplified fractions depending on what you need.

What Is Random Fraction Generator?

A random fraction generator built for math practice, worksheets, and demonstrations that need example fractions in a specific numeric range.

Numerator and denominator bounds are independent, so you can shape the kinds of fractions produced — for example, keeping denominators small for beginner-friendly practice.

How Random Fraction Generator Works

The tool draws a random denominator from its range first, re-rolling if it lands on zero (since a zero denominator is undefined), then draws a random numerator independently.

When reduction is enabled, it computes the greatest common divisor of the numerator and denominator with the Euclidean algorithm and divides both by it.

When To Use Random Fraction Generator

Use it to generate practice fractions for a math worksheet, or to demonstrate what a random fraction looks like before and after simplification.

Enable reduction when you want students to see fractions already in lowest terms; disable it to give them practice reducing fractions themselves.

Features

Advantages

  • Independent numerator and denominator ranges give fine control over the kinds of fractions generated.
  • Optional lowest-terms reduction handles the greatest common divisor math automatically.
  • Batch generation produces several fractions at once for a full worksheet.

Limitations

  • Not cryptographically secure — built on Math.random(), which is appropriate for this kind of educational/demo use.
  • Does not generate improper-fraction mixed numbers or negative fractions specially; negative numerators or denominators are treated as plain signed integers.

Examples

An unreduced fraction

Input

(no input; generated from settings: numerator 1-20, denominator 2-10, reduce off)

Output

12/8

A raw fraction with no simplification applied.

A reduced fraction

Input

(no input; generated from settings: numerator 4, denominator 8, reduce on)

Output

1/2

4/8 and 1/2 are equivalent; reduction divides both by their GCD of 4.

Best Practices & Notes

Best Practices

  • Turn reduction off when creating practice problems that ask students to simplify fractions themselves.
  • Keep denominator ranges away from zero if you want to avoid the tool needing to re-roll internally.

Developer Notes

The GCD helper treats a zero result (both inputs zero) as 1 to avoid a divide-by-zero when reducing, matching the convention that 0/0 is undefined but should not crash the generator.

Random Fraction Generator Use Cases

  • Generating practice fractions for a math worksheet
  • Demonstrating fraction simplification with before/after examples
  • Producing random ratio-like test data for a script or spreadsheet

Common Mistakes

  • Setting the denominator range to exactly [0, 0], which is rejected since every fraction would be undefined.
  • Expecting reduced fractions to always look 'smaller' — a fraction like 7/11 is already in lowest terms and won't change.

Tips

  • Set a wide numerator range and a narrow denominator range for fractions that are more likely to reduce interestingly.
  • Generate a batch with reduction off, then reduction on, to compare the two side by side.

References

Frequently Asked Questions