Math & Scientific

LCM & GCF Calculator

Find the Least Common Multiple (LCM) and Greatest Common Factor (GCF) of two whole numbers.

How it's calculated

The GCF is found using the Euclidean algorithm: repeatedly divide the larger number by the smaller and replace the larger with the remainder, until the remainder is zero — the last non-zero remainder is the GCF.

The LCM is then derived from the GCF using the identity LCM(a, b) = (a × b) ÷ GCF(a, b), which is faster than listing multiples of each number.

Worked example

For 12 and 18: the GCF is 6 (the largest number dividing both evenly), and the LCM is (12 × 18) ÷ 6 = 36.

Frequently asked questions

What's the difference between LCM and GCF?

The GCF is the largest number that divides both inputs evenly. The LCM is the smallest number that both inputs divide into evenly. They answer opposite questions.

Where is this used in real life?

GCF is used to simplify fractions to lowest terms; LCM is used to find a common denominator when adding fractions, or to schedule events that repeat at different intervals.

Related calculators