GCF and LCM Calculator

The greatest common factor (GCF) and least common multiple (LCM) of two or more whole numbers, with the Euclidean algorithm worked out step by step.

GCF -
LCM -

How it was solved

Steps

  1. Enter numbers above to see the working.

Prime factorizations

-

Formulas used

Concept Method
GCF via Euclid GCF(a, b) = GCF(b, a mod b), repeat until remainder 0
LCM from GCF LCM(a, b) = a × b ÷ GCF(a, b)
Three or more numbers GCF(GCF(a, b), c) and LCM(LCM(a, b), c)

Frequently asked questions

What is the GCF (greatest common factor)?

The greatest common factor — also called the greatest common divisor (GCD) — is the largest whole number that divides every number in a set with no remainder. For 24 and 36, both divide evenly by 12, so the GCF is 12.

What is the LCM (least common multiple)?

The least common multiple is the smallest positive number that is a multiple of every number in a set. For 4 and 6, the LCM is 12 — the first number both divide into evenly. It is commonly used to add fractions with different denominators.

How do I find the GCF and LCM of more than two numbers?

Reduce pairwise: GCF(GCF(a, b), c) and LCM(LCM(a, b), c). This calculator handles any count of numbers and shows each reduction step.

What is the relationship between GCF and LCM?

For any two numbers, GCF(a, b) × LCM(a, b) = a × b. For 12 and 18: GCF 6 × LCM 36 = 216 = 12 × 18.

What is the GCF and LCM of 12 and 18?

The GCF of 12 and 18 is 6 (the largest number dividing both), and the LCM is 36 (the smallest number both divide into).