What is GCD / HCF?
The Greatest Common Divisor (GCD), also known as Highest Common Factor (HCF), is the largest number that divides two or more integers without leaving a remainder.
GCD(48, 18) = 6
Because 6 is the largest number that divides both 48 and 18 evenly.
Because 6 is the largest number that divides both 48 and 18 evenly.
Euclidean Algorithm
The most efficient method to find GCD uses the Euclidean algorithm:
- Divide the larger number by the smaller number.
- Replace the larger number with the remainder.
- Repeat until remainder is 0.
- The last non-zero remainder is the GCD.
GCD(48, 18): 48 = 18×2 + 12 → 18 = 12×1 + 6 → 12 = 6×2 + 0 → GCD = 6