GCF and LCM Calculator
Find both the Greatest Common Factor (GCF / GCD) and Least Common Multiple (LCM / LCD) of two numbers simultaneously.
About the GCF and LCM Calculator
The Greatest Common Factor (GCF)βalso called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF)βis the largest positive integer that divides two numbers without a remainder. The Least Common Multiple (LCM) is the smallest positive integer that is divisible by both numbers.
Our GCF & LCM Calculator computes both values simultaneously, lists all factors of each input, and demonstrates the fundamental product relationship between GCF and LCM.
GCF and LCM Mathematical Formulas
For any two positive integers a and b:
GCF(a, b) = GCF(b, a mod b)LCM(a, b) = (a Γ b) Γ· GCF(a, b)GCF(a, b) Γ LCM(a, b) = a Γ bHow to Find the GCF and LCM of Two Numbers
- List the Factors to Find the GCF: Write down all divisors of
aand all divisors ofb. The largest number appearing in both lists is the GCF. - Multiply the Two Numbers Together: Calculate the product
a Γ b. - Divide by the GCF to Find the LCM: Divide
(a Γ b)byGCF(a, b)to get the exact Least Common Multiple.
Worked Example: For 12 and 18, the common factors are 1, 2, 3, and 6, so GCF = 6. Then LCM = (12 Γ 18) Γ· 6 = 216 Γ· 6 = 36.
Frequently Asked Questions (FAQ)
When should I use GCF vs. LCM in fraction problems?
Use the GCF when simplifying (reducing) a fraction to lowest terms. Use the LCM (also called the Least Common Denominator, LCD) when adding or subtracting fractions with different denominators.
What is the GCF and LCM of two prime numbers?
For any two distinct prime numbers p and q, their GCF is always 1, and their LCM is always their product (p Γ q).
Was this calculator helpful?
Help us improve our free step-by-step tools