GCF & LCM Calculator

Calculate Greatest Common Factor (GCD) and Least Common Multiple (LCM) of two numbers.

How to Calculate GCF and LCM

The Greatest Common Factor (GCF or GCD) is the largest positive integer that divides two numbers without a remainder. The Least Common Multiple (LCM) is the smallest positive integer that is a multiple of both numbers.

Euclidean Algorithm & LCM Relationship

LCM(a, b) = (|a × b|) / GCF(a, b)

The Euclidean algorithm repeatedly replaces (a, b) with (b, a mod b) until the remainder is zero. The last non-zero remainder is the GCF.

Step-by-Step Worked Examples

Example: GCF and LCM of 48 and 180

1. Euclidean division: 180 = 48 × 3 + 36
2. 48 = 36 × 1 + 12
3. 36 = 12 × 3 + 0.
The last non-zero remainder is GCF = 12.
LCM = (48 × 180) / 12 = 720.

Frequently Asked Questions

What is the difference between GCF and LCM?

GCF is the largest factor shared between two numbers (it divides both), while LCM is the smallest common multiple that both numbers divide into.

What does it mean if GCF(a, b) is 1?

If two numbers have a GCF of 1, they are called relatively prime (or coprime). Their LCM is simply their direct product a × b.