Loading Calculator...
Please wait a moment
Please wait a moment
Calculate Greatest Common Factor and Least Common Multiple together
The GCF is the largest positive integer that divides all given numbers without leaving a remainder. It's also called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF).
Example: GCF of 12 and 18
The LCM is the smallest positive integer that is divisible by all given numbers. It's the smallest number that appears in the multiplication table of each number.
Example: LCM of 12 and 18
For any two numbers a and b:
This beautiful relationship only works for exactly two numbers. It allows you to calculate one if you know the other: LCM = (a × b) ÷ GCF
GCF is the largest number that divides all given numbers (it's smaller than or equal to the smallest input), while LCM is the smallest number divisible by all given numbers (it's larger than or equal to the largest input). GCF finds common divisors, LCM finds common multiples.
This identity comes from the way prime factors combine for two numbers. With three or more numbers, the relationship becomes more complex because prime factors can appear with different frequencies across different numbers. For example, GCF(6,10,15) × LCM(6,10,15) = 1 × 30 = 30, but 6 × 10 × 15 = 900.
For fractions: GCF = GCF(numerators) ÷ LCM(denominators) and LCM = LCM(numerators) ÷ GCF(denominators). For example, for 2/3 and 4/5: GCF = GCF(2,4)/LCM(3,5) = 2/15, and LCM = LCM(2,4)/GCF(3,5) = 4/1 = 4.
When GCF = 1, the numbers are called 'relatively prime' or 'coprime'. They share no common factors except 1. In this case, their LCM equals their product. For example, GCF(8,15) = 1, so LCM(8,15) = 8 × 15 = 120.
Only when both numbers are the same! If a = b, then GCF(a,b) = LCM(a,b) = a. Otherwise, GCF is always less than or equal to the smallest number, and LCM is always greater than or equal to the largest number.
For GCF, the Euclidean algorithm is fastest for two numbers. For LCM, use the formula LCM = (a × b) ÷ GCF. For multiple numbers or when you need both, prime factorization is most efficient, especially when you can reuse the factorizations.