=Calculate
Math & numbers · Factors

GCF & LCM
calculator

The greatest common factor simplifies fractions; the least common multiple lines up denominators and repeating schedules. Enter two or three numbers and get both, with the prime breakdown.

2–3 numbersPrime factors shownNo sign-up
Factors & multiplesEuclid's algorithm
LCMleast common multiple
Prime factorseach number broken down

Two sides of divisibility

The GCF (greatest common factor) is the largest number dividing all your inputs — the tool that reduces 24/36 to 2/3. The LCM (least common multiple) is the smallest number they all divide into — the common denominator machine. They're linked by a tidy identity:

The identity (two numbers)
GCF × LCM = a × b
24 and 36
24 = 2³×3 · 36 = 2²×3²
GCF = 2²×3 = 12 · LCM = 2³×3² = 72 · check: 12×72 = 24×36 ✓

How it computes

Rather than factoring (slow for big numbers), the GCF uses Euclid's algorithm — repeatedly replacing the larger number with the remainder of the division, one of the oldest algorithms still in daily use (~300 BC). The LCM then falls out of the identity above.

Real uses

GCF simplifies fractions and ratios; LCM finds when repeating cycles align — buses every 12 and every 18 minutes meet every 36. Adding fractions with unlike denominators is LCM's home turf.

Common questions

GCF & LCM FAQ

Simplifying fractions and ratios: divide the numerator and denominator by their GCF to reach lowest terms. 24/36 ÷ 12 = 2/3.

Finding common denominators when adding fractions, and aligning repeating cycles — two events every 12 and 18 minutes coincide every 36 minutes (the LCM).

For two numbers, GCF × LCM = a × b. This calculator uses Euclid's algorithm for the GCF and derives the LCM from that identity.

Yes — add the optional third number. GCF and LCM both extend by applying the two-number operation repeatedly.