What Is the Greatest Common Factor?
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 whole numbers without leaving a remainder. For example, the GCF of 48 and 36 is 12, because 12 is the biggest number that evenly divides both. This calculator finds the GCF instantly and also reports the least common multiple (LCM).
How to Use the Calculator
Enter two non-negative whole numbers in the fields labeled a and b, then submit. The tool returns the greatest common factor along with the least common multiple. Order does not matter — \(\text{GCF}(48, 36)\) equals \(\text{GCF}(36, 48)\).
The Formula Explained
This calculator uses the Euclidean algorithm, an elegant method dating back to ancient Greece. It relies on the fact that the GCF of two numbers also divides their remainder. You repeatedly replace the pair \((a, b)\) with \((b, a \bmod b)\) until the second number becomes zero; the remaining first number is the GCF. The LCM is then found with the identity $$\text{lcm}(a, b) = \frac{a \times b}{\text{gcf}(a, b)}$$
Worked Example
Find the GCF of 48 and 36. Step 1: \(48 \bmod 36 = 12\), so the pair becomes \((36, 12)\). Step 2: \(36 \bmod 12 = 0\), so the pair becomes \((12, 0)\). Since the second value is 0, the GCF is 12. The LCM is $$\frac{48 \times 36}{12} = \frac{1728}{12} = 144$$
FAQ
What is the GCF if one number is 0? By definition, \(\text{GCF}(a, 0) = a\). The GCF of 0 and 0 is 0.
Is GCF the same as HCF? Yes. GCF, GCD, and HCF are different names for the same value.
When two numbers share no common factors, what is the GCF? It is 1, and the numbers are said to be coprime or relatively prime.